[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Sep 14 23:36:01 PDT 2003


Changes in directory llvm/lib/Analysis/IPA:

CallGraph.cpp updated: 1.25 -> 1.26

---
Log message:

These two conditions are not exclusive!!


---
Diffs of the changes:

Index: llvm/lib/Analysis/IPA/CallGraph.cpp
diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.25 llvm/lib/Analysis/IPA/CallGraph.cpp:1.26
--- llvm/lib/Analysis/IPA/CallGraph.cpp:1.25	Sun Sep 14 23:29:37 2003
+++ llvm/lib/Analysis/IPA/CallGraph.cpp	Sun Sep 14 23:35:16 2003
@@ -64,7 +64,7 @@
 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 @@
       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...
   //





More information about the llvm-commits mailing list