[LLVMdev] inserting a fucntion call at the end of basic bloc

Nabila ABDESSAIED nabila.abdessaied at gmail.com
Mon Apr 25 01:54:13 PDT 2011


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>


More information about the llvm-dev mailing list