Nabila ABDESSAIED
2011-Apr-25 08:54 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
hi all, i would like insert a fucntion call at the end of each basic bloc the fucntion i have defined and declared at the begining of the module ie i have written a pass derived from a module pass virtual bool runOnModule(Module & M){ // i declared the fucntion and defined it for (Module::iterator a = M.begin(), b = M.end(); a != b; for (Function::iterator i = a->begin(), e = a->end(); i != e; ++i) { //call the function } } } i tried to see an example with the demo, i saw that it instead of calling the function, it repeats all the instruction that are existing in the function Any help? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110425/a90c2346/attachment.html>
Duncan Sands
2011-Apr-25 09:33 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
Hi Nabila,> i would like insert a fucntion call at the end of each basic blocyou can't, because only terminators are allowed at the end of a basic block. However you can try to insert the call before the terminator. ...> i tried to see an example with the demo, i saw that it instead of calling the > function, it repeats all the instruction that are existing in the function > Any help?Turn off optimization in the demo (optimization level "None"). Ciao, Duncan.
Nabila ABDESSAIED
2011-Apr-25 09:55 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
2011/4/25 Duncan Sands <baldrick at free.fr>> Hi Nabila, > > > i would like insert a fucntion call at the end of each basic bloc > > you can't, because only terminators are allowed at the end of a basic > block. > However you can try to insert the call before the terminator. >Yes, i mean before the termininator, My problem is how to call a method suppose this fucntion void A(int x) { x=x+1; } should i define this function and declare it at the beginig of the module and create for it a basic bloc? and then how to call it before each basic bloc terminitor ...> > > i tried to see an example with the demo, i saw that it instead of calling > the > > function, it repeats all the instruction that are existing in the > function > > Any help? > > Turn off optimization in the demo (optimization level "None"). > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110425/88e8b589/attachment.html>
Maybe Matching Threads
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc