[cfe-dev] Missing edges in analysis call graph

Daniel DeFreez dcdefreez at ucdavis.edu
Thu Nov 20 16:34:03 PST 2014

Thanks for your reply Anna. I finally got a chance to play around with this
again today.

 I believe with your patch, the node will get added, but the definition
> used will not have the body attached to it, so the analyzer will not
> process the body.

Hmm, doesn't the analyzer itself use getBody() to access the body, thereby
walking the list of redeclarations? It seems like it is still processing
the body of the function, but maybe I don't know what to look for.

> How about changing the logic in the CallGraph to check if there is a
> redeclaration with the body and insert that one insted of the one
> referenced by the call? (This could also be handled on the analyzer side,
> but I think all the CallGraph users might prefer the declarations that have
> the bodies attached when those are available.) I would try to use hasBody,
> followed by getBody(). What do you think?

It isn't obvious to me how to do this with hasBody / getBody directly,
since the call graph node Decl isn't const. However, it can be easily done
by iterating over redecls() and testing each with
doesThisDeclarationHaveABody. It seems to work. Any problems with this

Is cfe-commits the place to submit the actual patch?

Thanks again for you help,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141121/085235fe/attachment.html>

More information about the cfe-dev mailing list