Displaying 3 results from an estimated 3 matches for "insertnewinstsbefore".
2007 Mar 06
6
[LLVMdev] alloca & store generation
...ode in my transformation:
-----
BasicBlock* eb = M.getMainFunction()->getEntryBlock();
Function::arg_iterator argc_it = mainfun->arg_begin();
Function::arg_iterator argv_it = argc_it;
++argv_it;
Argument* argc = &*argc_it;
Argument* argv = &*argv_it;
Instruction* insertNewInstsBefore = &eb->front();
AllocaInst* argc_alloca = new AllocaInst(argc->getType(), "",
insertNewInstsBefore);
AllocaInst* argv_alloca = new AllocaInst(argv->getType(), "",
insertNewInstsBefore);
new StoreInst(argc, argc_alloca, false, insertNewInstsB...
2007 Mar 06
0
[LLVMdev] alloca & store generation
...t; BasicBlock* eb = M.getMainFunction()->getEntryBlock();
> Function::arg_iterator argc_it = mainfun->arg_begin();
> Function::arg_iterator argv_it = argc_it;
> ++argv_it;
> Argument* argc = &*argc_it;
> Argument* argv = &*argv_it;
> Instruction* insertNewInstsBefore = &eb->front();
> AllocaInst* argc_alloca = new AllocaInst(argc->getType(), "",
> insertNewInstsBefore);
> AllocaInst* argv_alloca = new AllocaInst(argv->getType(), "",
> insertNewInstsBefore);
> new StoreInst(argc, argc_alloc...
2007 Mar 06
0
[LLVMdev] alloca & store generation
...uctions?
Because you pass in an empty string for the name in the new AllocaInst
calls below. Replace the empty strings with "argc_addr" or whatever
you want.
> AllocaInst* argc_alloca = new AllocaInst(argc->getType(), "",
> insertNewInstsBefore);
> AllocaInst* argv_alloca = new AllocaInst(argv->getType(), "",
> insertNewInstsBefore);