1 Dec 2002 13:15
How to get a Module DSGraph?
Chris Lattner <sabre <at> nondot.org>
2002-12-01 12:15:01 GMT
2002-12-01 12:15:01 GMT
On Sat, 30 Nov 2002, Juan Nicolas Ruiz wrote:
> I've been trying to obtain a DSGraph for a complete module, but
> haven't succeeded. I tried
First off, there is no one way to get a DSGraph for a module. What you do
to get it depends on what kind of information you are interested in...
> - getting the DSGraph for each function, and copying the nodes to a
> Module graph. But since there are no nodehandles, apparently there is
> no merging of nodes.
This works fine, you just have to merge the formal and actual arguments
(and the return value) of functions with their call sites. This ends up
giving you a "steensgaard's" style IP DSGraph. In fact, if you look in
the DataStructure directory, the Steensgaards.cpp file contains a
(partial) implementation of this. It doesn't handle function pointers or
any of that fun stuff yet, but you should be able to get the main idea
from it...
> My main interest is in situations like
>
> void *M(int size) {
> return malloc(size);
> }
> void F() {
> void *p = M(....);
> }
> where I can identify that %p and the object returned by M() are the
> same.
(Continue reading)
RSS Feed