[LLVMdev] DSGraph::mergeInGraph usage?

Chris Lattner sabre at nondot.org
Mon Nov 25 01:31:01 PST 2002


On Sun, 24 Nov 2002, Juan Nicolas Ruiz wrote:
> I've been trying to merge DSGraphs from different Functions, but i'm
> not going anywhere. For a Function F and DSGraph G, I tried this
> (assumming no SCC in the callgraph):

> vector<DSCallSite> CSV = G->getAuxFunctionCalls();

Are you sure this is returning any call site entries?  Depending on what
_type_ of graph G is, it may be empty.  If G is a local graph, it's empty.
If G is a BU graph, CSV will only contain "unresolvable" call sites.  You
probably want just the getFunctionCalls() list, which is the set of
function calls originally found by the Local's pass.

If that doesn't help, you'll have to give me some more details about what
is not happening: is the mergeInGraph function even being called?

-Chris


> for (vector<DSCallSite>::iterator I = CSV.begin(), E = CSV.end();
>      I != E; I++) {
>   Value *V = I->getCallInst().getOperand(0);
>   Function &SF = cast<Function>(*V);
>   if (!SF.isExternal()) {
>     DSGraph *SFG = new DSGraph(SF, GG);
>     G->mergeInGraph(*I, *SFG, 0);
>   }
> }
>
> but the resulting graph has no new merged DSNodes, even though in my
> test case there is a DSNode pointed by the CallInst in F and another
> DSNode in G that is returned to F.
>
> Any ideas on what I'm doing wrong?
>
> nicolas
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list