get TopDown DSGraph

Dear LLVM,

I was wondering if this is the right way to get TopDown DSGraph?

TDDataStructures &TD = getAnalysis<TDDataStructures>();
F is some function
DSGraph &dsg = TD.getDSGraph(F);

I found out the DSGraph I got using this method is actually bottom up
DSGraph, can you let me know why?

Thanks,
xiaodong

I was wondering if this is the right way to get TopDown DSGraph?
TDDataStructures &TD = getAnalysis<TDDataStructures>();
F is some function
DSGraph &dsg = TD.getDSGraph(F);

Yes, that's the right way.

I found out the DSGraph I got using this method is actually bottom up
DSGraph, can you let me know why?

Why do you think it's a BU graph?

-Chris

Thanks, Chris. Actually I got the following graph from my program:

digraph DataStructures {
  label="Function fini";
  edge [arrowtail="dot"];
  size="10,7.5";
  rotate="90";

  Node0x100ae1c40 [shape=record,shape=Mrecord,label="{ %struct.a:
HIMR\n|{<g0>|<g1>|<g2>}}"];
  Node0x100ae1c40:g1 -> Node0x100ae1e00;
  Node0x100ae1c40:g2 -> Node0x100ae1fc0;
  Node0x100ae1e00 [shape=record,shape=Mrecord,label="{ %struct.a:
HIMR\n|{<g0>|<g1>|<g2>}}"];
  Node0x100ae1e00:g1 -> Node0x100ae0b30;
  Node0x100ae1e00:g2 -> Node0x100ae1d20;
  Node0x100ae0b30 [shape=record,shape=Mrecord,label="{ void: HI\n}"];
  Node0x100ae1d20 [shape=record,shape=Mrecord,label="{ void: HI\n}"];
  Node0x100ae1fc0 [shape=record,shape=Mrecord,label="{ void: HI\n}"];
  Node0x100aebf90[ plaintext=circle, label =" %my"];
  Node0x100aebf90 -> Node0x100ae1c40[arrowtail=tee,color=gray63];

If you look at it, you'll see each node has the InComplete Bit on.
But when I use 'analyze -tddatastructure file.bc' I got the graph in which
all the nodes don't have the bit on. So they are different. Could you tell
me why the results from the analyze tool and from the dsg.dump() are
different?

Besides, each time I call the getAnaysis<TDDataStructure>(), it writes out
some bu_funname.dot files to the disk. Why is that?

Thanks,
xiaodong

If you look at it, you'll see each node has the InComplete Bit on.
But when I use 'analyze -tddatastructure file.bc' I got the graph in which
all the nodes don't have the bit on. So they are different. Could you tell
me why the results from the analyze tool and from the dsg.dump() are
different?

The nodes are marked incomplete because they are pointed to by arguments
to the function, and we currently don't ensure that all callees are known
of the function, thus we are unable to mark the argument pointers
complete. Sorry about this, I just haven't had the time to get this
implemented, and it looks unlikely that it will happen before the end of
the semester. :frowning:

Besides, each time I call the getAnaysis<TDDataStructure>(), it writes out
some bu_funname.dot files to the disk. Why is that?

This should be fixed by now, if not, let me know.

-Chris