<div dir="ltr"><div><div><div>But I don't want to map only basic blocks, I need too to map the edges "the whole CFG of the function"<br></div><div><b>Yes. First you create simple methods to create an integer graph and to addEdge. Then, two types of edges: between basic blocks inside a function (you can use LLVM succesors) and between functions (use Call/Return/ and identify the pairs (Callee/Caller), so you can add edges between the correspondent basic blocks from different functions.</b><br>
</div>Save
 the CFG of the function in another memory address and call it for 
example orgCFG and change the CFG by referencing to the orgCFG<br></div><div><b>So first make all the changes on orgCFG (the integers CFG) and then, in another transformation pass: modify your old CFG (by removing./adding, which I don't recommand) or add metadata (keeps information about the changes you want to make, but you don't actually make)</b><br>

</div>Thank you for help and patience<br></div><b>Good luck !</b><br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 10:43 PM, Rasha Omar <span dir="ltr"><<a href="mailto:rasha.sala7@gmail.com" target="_blank">rasha.sala7@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>But I don't want to map only basic blocks, I need too to map the edges "the whole CFG of the function"<br>
</div>Save the CFG of the function in another memory address and call it for example orgCFG and change the CFG by referencing to the orgCFG<br>
</div><div>Thank you for help and patience <br></div></div><div class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 June 2013 10:59, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I don't use a function for do the mapping, it may be <span style="font-family:arial,sans-serif;font-size:13px">MapValue(). If it does not work, alias an int identifier for each basic block. Be aware because basic block cannot have the same name (getName) in the same function, but they might have the same name being in different functions. Therefore, take into account the function name as well.</span><div>


<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Good luck</span></div></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Thu, Jun 6, 2013 at 10:55 AM, Rasha Omar <span dir="ltr"><<a href="mailto:rasha.sala7@gmail.com" target="_blank">rasha.sala7@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div dir="ltr"><div>I think I understood that, but what I mean is what is the function responsible to do mapping is it MapValue() in ValueMapper.h?<br><br></div><div>Thanks for your help<br></div><br></div><div>
<div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 6 June 2013 09:54, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Map every basic block from the CFG to a set of integers. The successors from the CFG can be used to make the edges in your simplified graph. The pair (Callee,Caller) can link the CFG-s between them in a larger CFG-like.</div>



<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 5, 2013 at 11:03 PM, Rasha Omar <span dir="ltr"><<a href="mailto:rasha.sala7@gmail.com" target="_blank">rasha.sala7@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">What do you mean by mapping to integers?<br></div><div><div><div class="gmail_extra">

<br><br><div class="gmail_quote">On 5 June 2013 22:32, Alexandru Ionut Diaconescu <span dir="ltr"><<a href="mailto:alexandruionutdiaconescu@gmail.com" target="_blank">alexandruionutdiaconescu@gmail.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Why you don't map the basic blocks to integers and apply algorithms on the integer graph? And construct your new CFG.<br>





</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Wed, Jun 5, 2013 at 10:27 PM, Rasha Omar <span dir="ltr"><<a href="mailto:rasha.sala7@gmail.com" target="_blank">rasha.sala7@gmail.com</a>></span> wrote:<br>






</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div>How could I keep the function CFG in another memory space.<br>

</div>I want to be able to change one of the old CFG , but keeping the original one in another space.<br>
</div>Thanks<span><font color="#888888"><br clear="all"><div>
<div><div><div><div><div><br>-- <br><div dir="ltr"><b><span style="color:rgb(0,0,102)">Rasha Salah Omar</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Msc Student at E-JUST</span><br style="color:rgb(0,0,102)">







<span style="color:rgb(0,0,102)">Demonestrator  at Faculty of Computers and Informatics</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Benha University</span><br></b></div>
</div></div></div></div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<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/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)"><font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>







</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><b><span style="color:rgb(0,0,102)">Rasha Salah Omar</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Msc Student at E-JUST</span><br style="color:rgb(0,0,102)">





<span style="color:rgb(0,0,102)">Demonestrator  at Faculty of Computers and Informatics</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Benha University</span><br></b></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)">
<font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><b><span style="color:rgb(0,0,102)">Rasha Salah Omar</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Msc Student at E-JUST</span><br style="color:rgb(0,0,102)">



<span style="color:rgb(0,0,102)">Demonestrator  at Faculty of Computers and Informatics</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Benha University</span><br></b></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><font style="color:rgb(153,153,153)">Best regards,</font><br style="color:rgb(153,153,153)">
<font style="color:rgb(153,153,153)">Alexandru Ionut Diaconescu</font><br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><b><span style="color:rgb(0,0,102)">Rasha Salah Omar</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Msc Student at E-JUST</span><br style="color:rgb(0,0,102)">

<span style="color:rgb(0,0,102)">Demonestrator  at Faculty of Computers and Informatics</span><br style="color:rgb(0,0,102)"><span style="color:rgb(0,0,102)">Benha University</span><br></b></div>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <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></div></div>