Displaying 1 result from an estimated 1 matches for "dofoo".
Did you mean:
do_foo
2015 Aug 19
5
creating a callinst to an external function
...);
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, "", bb);
Note: Args2 is an arraylist containing 2 value pointers to a function and a basicblock, bb is the basicblock to insert the call in.
When I run the pass using op on a given IR, it p...