Correct callgraph construction. It has two problems:
authorDuncan Sands <baldrick@free.fr>
Tue, 9 Sep 2008 12:40:47 +0000 (12:40 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 9 Sep 2008 12:40:47 +0000 (12:40 +0000)
commit99c1a7c9e1f501878040f3adcac342b2d8201709
tree84e793a7309ee3a60aa0256992a89cc3c7ef4de9
parent076055ccd3a542959c9bbce593ed6bd4005e04b5
Correct callgraph construction.  It has two problems:
(1) code left over from the days of ConstantPointerRef:
if a use of a function is a GlobalValue then that is
not considered a reason to add an edge from the external
node, even though the use may be as an initializer for
an externally visible global!  There might be some point
to this behaviour when the use is by an alias (though the
code predated aliases by some centuries), but I think
PR2782 is a better way of handling that.  (2) If function
F calls function G, and also G is a parameter to the
call, then an F->G edge is not added to the callgraph.
While this doesn't seem to matter much, adding such an
edge makes the callgraph more regular.
In addition, the new code should be faster as well as
simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55987 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IPA/CallGraph.cpp
test/Analysis/CallGraph/2008-09-09-DirectCall.ll [new file with mode: 0644]
test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll [new file with mode: 0644]
test/Analysis/CallGraph/dg.exp [new file with mode: 0644]