Displaying 1 result from an estimated 1 matches for "ptrtofuncty".
2015 Aug 19
5
creating a callinst to an external function
...expected.
Not back to the instrumentation pass. How can I insert a callinst to the foo function in the given IR?
Here is the snippet that inserts the call:
Type* retTy = Type::getInt32Ty(C);
FunctionType* FuncTy = FunctionType::get(retTy, false);
PointerType* PtrToFuncTy = PointerType::get(FuncTy, 0);
Constant *fun = M->getOrInsertFunction("foo", Type::getVoidTy(C), PtrToFuncTy, Type::getLabelTy(C), nullptr);
Function *dofoo = cast<Function>(fun);
Instruction* dofooCall = CallInst::Create(fun, Args2, "&...