I tried to insert an assembly instruction into each base block using pass in the IR Pass of LLVM.
BasicBlock::iterator IP = BB.getFirstInsertionPt(); IRBuilder<> IRB(&(*IP)); StringRef asmString = "int3"; StringRef constraints = ""; llvm::InlineAsm *IA = llvm::InlineAsm::get(Ty,asmString,constraints,true,false,InlineAsm::AD_ATT); ArrayRef<Value *> Args = None; llvm::CallInst *Ptr = IRB.CreateCall(IA,Args);
However, the following error occurs during execution
Assertion `Verify(getFunctionType(), constraints) && "Function type not legal for constraints!"' failed.
But I don’t know why. What can I do about it. Thanks.