This is an archive of the discontinued LLVM Phabricator instance.

[[Clang CallGraph]] CallGraph should still record calls to decls.
ClosedPublic

Authored by erichkeane on Mar 19 2020, 9:52 AM.

Details

Summary

Discovered by a downstream user, we found that the CallGraph ignores
callees unless they are defined. This seems foolish, and prevents
combining the report with other reports to create unified reports.
Additionally, declarations contain information that is likely useful to
consumers of the CallGraph.

This patch implements this by splitting the includeInGraph function into
two versions, the current one plus one that is for callees only. The
only difference currently is that includeInGraph checks for a body, then
calls includeCalleeInGraph.

Diff Detail

Event Timeline

erichkeane created this revision.Mar 19 2020, 9:52 AM
lebedev.ri added inline comments.Mar 19 2020, 11:04 AM
clang/test/Analysis/debug-CallGraph.cpp
84–100

Can you precommit these?

erichkeane marked 2 inline comments as done.Mar 19 2020, 12:02 PM
erichkeane added inline comments.
clang/test/Analysis/debug-CallGraph.cpp
84–100
erichkeane marked an inline comment as done.

Precommited the test.

lebedev.ri accepted this revision.Mar 19 2020, 12:29 PM

LGTM unless @NoQ has concerns.

This revision is now accepted and ready to land.Mar 19 2020, 12:29 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2020, 9:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Whoops, i did not see cfe-commits again got sidestepped.