aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-15 04:35:16 +0000
committerChris Lattner <sabre@nondot.org>2003-09-15 04:35:16 +0000
commitf52d01bbc58c116f7c83f3320a0f2dff9ac1b3d6 (patch)
tree0ace2cb563371d789872a4defddb450d62b5db5e /lib
parentb31247a840ffac5d6b0b29c8690855ca678193ea (diff)
downloadexternal_llvm-f52d01bbc58c116f7c83f3320a0f2dff9ac1b3d6.zip
external_llvm-f52d01bbc58c116f7c83f3320a0f2dff9ac1b3d6.tar.gz
external_llvm-f52d01bbc58c116f7c83f3320a0f2dff9ac1b3d6.tar.bz2
These two conditions are not exclusive!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 980d119..d5cbe3d 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -64,7 +64,7 @@ CallGraphNode *CallGraph::getNodeFor(Function *F) {
void CallGraph::addToCallGraph(Function *F) {
CallGraphNode *Node = getNodeFor(F);
- // If this function has external linkage,
+ // If this function has external linkage, anything could call it...
if (!F->hasInternalLinkage()) {
ExternalNode->addCalledFunction(Node);
@@ -75,9 +75,12 @@ void CallGraph::addToCallGraph(Function *F) {
else
Root = Node; // Found a main, keep track of it!
}
- } else if (F->isExternal()) { // Not defined in this xlation unit?
- Node->addCalledFunction(ExternalNode); // It could call anything...
}
+
+ // If this function is not defined in this translation unit, it could call
+ // anything.
+ if (F->isExternal())
+ Node->addCalledFunction(ExternalNode);
// Loop over all of the users of the function... looking for callers...
//