[cfe-dev] get basicblock

孟凡印 mengfanyin2013 at gmail.com
Mon Aug 5 01:08:27 PDT 2013


Hi All

     When I using the method as following to get the basicblocks from
function(.bc generated by clang 3.3) ,but it does not work. After
comparing to past version of clang,the differences are that the
basicblock lable in the IR generated by clang 3.3 are expressed by way
of noting,like this:";<lable>:5".

     Now I could ask you how I can get the basicblock ?Thank you all!







http://llvm.org/releases/3.3/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-basicblock

*******************************************************************

for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i)
  // Print out the name of the basic block if it has one, and then the
  // number of instructions that it contains
  errs() << "Basic block (name=" << i->getName() << ") has "
             << i->size() << " instructions.\n";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130805/03920341/attachment.html>


More information about the cfe-dev mailing list