[llvm-commits] CVS: llvm/lib/Transforms/IPO/Inliner.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Apr 20 15:21:02 PDT 2004


Changes in directory llvm/lib/Transforms/IPO:

Inliner.cpp updated: 1.9 -> 1.10

---
Log message:

Fix PR324: http://llvm.cs.uiuc.edu/PR324  and testcase: Inline/2004-04-20-InlineLinkOnce.llx


---
Diffs of the changes:  (+7 -3)

Index: llvm/lib/Transforms/IPO/Inliner.cpp
diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.9 llvm/lib/Transforms/IPO/Inliner.cpp:1.10
--- llvm/lib/Transforms/IPO/Inliner.cpp:1.9	Mon Apr 12 00:37:29 2004
+++ llvm/lib/Transforms/IPO/Inliner.cpp	Tue Apr 20 15:20:59 2004
@@ -120,13 +120,17 @@
               (Callee->hasInternalLinkage() || Callee->hasLinkOnceLinkage())) {
             DEBUG(std::cerr << "    -> Deleting dead function: "
                             << Callee->getName() << "\n");
-            std::set<Function*>::iterator I = SCCFunctions.find(Callee);
-            if (I != SCCFunctions.end())    // Remove function from this SCC.
-              SCCFunctions.erase(I);
+            SCCFunctions.erase(Callee);    // Remove function from this SCC.
 
             // Remove any call graph edges from the callee to its callees.
             while (CalleeNode->begin() != CalleeNode->end())
               CalleeNode->removeCallEdgeTo(*(CalleeNode->end()-1));
+
+            // If the function has external linkage (basically if it's a
+            // linkonce function) remove the edge from the external node to the
+            // callee node.
+            if (!Callee->hasInternalLinkage())
+              CG.getExternalCallingNode()->removeCallEdgeTo(CalleeNode);
 
             // Removing the node for callee from the call graph and delete it.
             delete CG.removeFunctionFromModule(CalleeNode);





More information about the llvm-commits mailing list