<div dir="ltr">Hi All<pre style><span class=""> 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".</span></pre>
<pre style><span class=""> Now I could ask you how I can get the basicblock ?Thank you all!</span></pre><pre style><span class=""> </span></pre><pre style><span class=""> <br> </span></pre><pre><span class=""><br>
</span></pre><pre><span class=""><br></span></pre><pre><span class=""><br></span></pre><pre><span class=""><a href="http://llvm.org/releases/3.3/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-basicblock">http://llvm.org/releases/3.3/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-basicblock</a><br>
</span></pre><pre><span class="">*******************************************************************</span></pre><pre><span class="">for</span> <span class="">(</span><span class="">Function</span><span class="">::</span><span class="">iterator</span> <span class="">i</span> <span class="">=</span> <span class="">func</span><span class="">-></span><span class="">begin</span><span class="">(),</span> <span class="">e</span> <span class="">=</span> <span class="">func</span><span class="">-></span><span class="">end</span><span class="">();</span> <span class="">i</span> <span class="">!=</span> <span class="">e</span><span class="">;</span> <span class="">++</span><span class="">i</span><span class="">)</span>
<span class="">// Print out the name of the basic block if it has one, and then the</span>
<span class="">// number of instructions that it contains</span>
<span class="">errs</span><span class="">()</span> <span class=""><<</span> <span class="">"Basic block (name="</span> <span class=""><<</span> <span class="">i</span><span class="">-></span><span class="">getName</span><span class="">()</span> <span class=""><<</span> <span class="">") has "</span>
<span class=""><<</span> <span class="">i</span><span class="">-></span><span class="">size</span><span class="">()</span> <span class=""><<</span> <span class="">" instructions.</span><span class="">\n</span><span class="">"</span><span class="">;</span></pre>
<div> </div><h4> </h4></div>