Displaying 2 results from an estimated 2 matches for "addcallsit".
Did you mean:
addcallsite
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...on calls in the LLVM IR using the IRBuilder
class. I've read both tutorials about functions but I still get
assertion errors. I allocate memory for all function arguments and pass
them as explained in the tutorial.
My code is (this function is supposed to add a call to f in bb at pos):
void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) {
std::vector<Value*> args;
IRBuilder<> builder(bb,pos);
for(Function::arg_iterator argit =
f->arg_begin();argit!=f->arg_end();argit++){
AllocaInst* allocInst = builder.CreateAlloca(argit->getType());
ar...
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...ing the IRBuilder
> class. I've read both tutorials about functions but I still get
> assertion errors. I allocate memory for all function arguments and pass
> them as explained in the tutorial.
>
> My code is (this function is supposed to add a call to f in bb at pos):
> void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) {
> std::vector<Value*> args;
> IRBuilder<> builder(bb,pos);
> for(Function::arg_iterator argit =
> f->arg_begin();argit!=f->arg_end();argit++){
> AllocaInst* allocInst = builder.CreateAlloca(argit->...