We have built a tool which will take in a CDFG (in a particular format) and do some design automation based on it. The effort is to extend this tool to take an input from in the form of a systemC (extension of C++) code. The IR was used to generate the CDFG of the source code.<br>
<br>But the requirement is to generate the CDFG of only a specific function and hence I am looking to iterate over the member functions only. Currently, I was achieving this by filtering out the function by their name. But evidently this is inefficient. <br>
<br>Will I be able to achieve this (iterating over member functions alone and generate a CDFG of it) using clang?<br><br>Regards,<br>Sandeep<br><br><br><div class="gmail_quote">On Thu, Jul 7, 2011 at 9:47 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On looking into the IR (dumped out in human readable format), I see that the class defined in the source code has been stripped out of its member functions and only a structure containing the member variables is created. The member functions are written out separately with their mangled names. Hence, I suspect if it is possible to iterate over only the member functions of a particular class. <br>

</blockquote><div><br></div></div><div>Indeed, as you've seen (& so far as I know), LLVM IR is too low level for your task - there are no member functions at this level, they've all been transformed into free functions and structs. <br>

<br>What kind of optimization were you hoping to implement based on this information? <br><br>If you aren't trying to implement an optimization, but instead try to process source code in some way (indexing, source to source transformations, etc) then you might want to use clang instead. </div>

</div>
</blockquote></div><br>