search for: argit

Displaying 5 results from an estimated 5 matches for "argit".

Did you mean: argi
2016 Mar 14
4
LLVM 3.8 change in function argument lists?
Hi, I am upgrading my project from 3.7 to 3.8. I find that following code used to compile in 3.7 but doesn't in 3.8 and I can't understand why. llvm::Function *mainFunc = ...; auto argiter = mainFunc->arg_begin(); llvm::Value *arg1 = argiter++; arg1->setName("obj"); But if I change the code to following it compiles: auto argiter = mainFunc->arg_begin(); llvm::Value *arg1 = &(*argiter); arg1->setName("obj"); As far as I can tell the first vers...
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...guments 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()); args.push_back(allocInst); } builder.CreateCall(f,args.begin(),args.end()); } This seems to work for functions without parameters (eg. int foo()), but once a fu...
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...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()); >      args.push_back(allocInst); >  } >  builder.CreateCall(f,args.begin(),args.end()); > } > > This seems to work for functions without paramete...
2016 Feb 10
5
Question about an error we're now starting to get on LLVM 3.8.0rc2since
...evin <Kevin.Harris at unisys.com> wrote: > > Duncan, > Kevin Harris here, from Unisys. In our application, generating LLVM IR, we have several instances of code that looks like this: > > . . . > Value* pDS; > . . . > auto argIt = pFunc->arg_begin(); > pDS = argIt; > . . . > > This construct works fine in 3.7, but in LLVM 3.8.0rc2, I’m now getting an error: > > g++-5.2.0 `/home/kharris/dyntrans/llvm-install/bin/llvm-config --cxxflags` -D JITREV="\"4793\"&q...
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...space on the stack. Suppossing that the function parameters simple enough, like integral or floating point types, and the "default value" is zero, something like this will do (untested): std::vector<Value*> args; IRBuilder<> builder(bb,pos); for(Function::arg_iterator argit = f->arg_begin();argit!=f->arg_end(); argit++) { Value *arg = Constant::getNullValue(argit->getType()); args.push_back(arg); } builder.CreateCall(f,args.begin(),args.end()); If your arguments are something more fancy, you have more work ahead (for following...