<div dir="ltr">Thank you !</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 1:24 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div class="im"><br>
<br>
On 26/04/13 13:17, Alexandru Ionut Diaconescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the response.<br>
I looked and I cannot see what exactly I need. I saw getCalledFunction() so I<br>
need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an<br>
instruction. It seems not easier than the "unelegant" version....if I am still<br>
at the Instruction level...<br>
</blockquote>
<br></div>
the call graph gives you a graph where the nodes are functions, and there is an<br>
edge from function F to function G if function F calls function G.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I need a method that takes from a "leaf" basic block from a function (Maybe<br>
there is the possibility not to have only one "end" basic block) the connection<br>
with an entry basic block of another function.<br>
</blockquote>
<br></div>
Most functions don't end in a call to another function, they end by returning<br>
control to the function that called them.<br>
<br>
Ciao, Duncan.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
Thank you !<br>
<br>
<br>
<br>
On Fri, Apr 26, 2013 at 1:04 PM, Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a><br></div><div class="im">
<mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>> wrote:<br>
<br>
    Hi,<br>
<br>
<br>
    On 26/04/13 11:19, Alexandru Ionut Diaconescu wrote:<br>
<br>
        Hello,<br>
<br>
        I try to make a big CFG (control flow graph) by combining all the CFG-s<br>
        from all<br>
        the functions of a module. I still have one problem : I want to get the<br>
        links<br>
        between functions.<br>
<br></div>
        For CFG-s, I used CallGraphNode->second->__<u></u>getFunction, then<div class="im"><br>
        Function_iterators<br>
        and succ_iterators, so I have all the links between BBs. Now, the<br>
        questions is<br>
        how do I link BBs from different functions?<br>
<br>
        I can do it in a way not so elegant. Take the last BB of every function,<br>
        then<br>
        getTerminator and see that function it is called and then link to<br>
        (instruction-2-instruction).<br>
<br>
<br>
    calls don't have to be terminators, so that wouldn't work properly anyway.<br>
<br>
<br>
<br>
        There must be there a better way to get the linkage between BBs that are in<br>
        different functions.<br>
<br>
<br></div>
    Sure, take a look at include/llvm/Analysis/__<u></u>CallGraph.h<br>
<br>
    Ciao, Duncan.<br>
    ______________________________<u></u>___________________<br>
    LLVM Developers mailing list<br>
    <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>

    <a href="http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/__<u></u>mailman/listinfo/llvmdev</a><div class="im"><br>
    <<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a>><br>
<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Alexandru Ionut Diaconescu<br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Best regards,</font><br style="background-color:rgb(255,255,255);color:rgb(153,153,153)">
<font style="background-color:rgb(255,255,255);color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div>