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

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 13 12:31:01 PDT 2002


Changes in directory llvm/lib/Transforms/IPO:

FunctionResolution.cpp updated: 1.13 -> 1.14

---
Log message:

Account for global variables resolved more accurately.


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp
diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.13 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.14
--- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.13	Wed Oct  9 16:10:06 2002
+++ llvm/lib/Transforms/IPO/FunctionResolution.cpp	Sun Oct 13 12:30:30 2002
@@ -236,14 +236,16 @@
     // later.
     //
     if (Globals[i]->isExternal() && Globals[i]->use_empty()) {
-      if (isFunction)
+      if (isFunction) {
         M.getFunctionList().erase(cast<Function>(Globals[i]));
-      else
+        ++NumResolved;
+      } else {
         M.getGlobalList().erase(cast<GlobalVariable>(Globals[i]));
+        ++NumGlobals;
+      }
 
       Globals.erase(Globals.begin()+i);
       Changed = true;
-      ++NumResolved;
     } else if (isFunction) {
       // For functions, we look to merge functions definitions of "int (...)"
       // to 'int (int)' or 'int ()' or whatever else is not completely generic.





More information about the llvm-commits mailing list