[LLVMdev] Instruction insertion By Module Pass
rasha.sala7 at gmail.com
Tue Jul 30 05:44:27 PDT 2013
I need to insert new instruction into every basic block like x=1
or while loop
I tried this code, but it doesn't work
Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext());
AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb);
llvm::BasicBlock>::addNodeToList(ValueSubClass *) [ValueSubClass =
llvm::Instruction, ItemParentClass = llvm::BasicBlock]: Assertion
`V->getParent() == 0 && "Value already in a container!!"' failed.
Is there a class I could use to insert while loop in Module Pass?
Thank you in advance
* Rasha Salah Omar
Msc Student at E-JUST
Demonestrator at Faculty of Computers and Informatics
* e-mail: rasha.omar at ejust.edu.eg*
P* Please consider the environment before printing this email.*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev