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

LLVM llvm at cs.uiuc.edu
Sat Jul 17 17:23:08 PDT 2004



Changes in directory llvm/lib/Transforms/IPO:

Inliner.cpp updated: 1.16 -> 1.17

---
Log message:

bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Replace ConstantPointerRef usage with GlobalValue usage


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

Index: llvm/lib/Transforms/IPO/Inliner.cpp
diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.16 llvm/lib/Transforms/IPO/Inliner.cpp:1.17
--- llvm/lib/Transforms/IPO/Inliner.cpp:1.16	Sat Jun 19 23:11:48 2004
+++ llvm/lib/Transforms/IPO/Inliner.cpp	Sat Jul 17 19:22:58 2004
@@ -14,7 +14,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "Inliner.h"
-#include "llvm/Constants.h"   // ConstantPointerRef should die
 #include "llvm/Module.h"
 #include "llvm/iOther.h"
 #include "llvm/iTerminators.h"
@@ -174,9 +173,9 @@
     // If the only remaining use of the function is a dead constant
     // pointer ref, remove it.
     if (F && F->hasOneUse())
-      if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(F->use_back()))
-        if (CPR->use_empty()) {
-          CPR->destroyConstant();
+      if (Function *GV = dyn_cast<Function>(F->use_back()))
+        if (GV->removeDeadConstantUsers()) {
+	  delete GV;
           if (F->hasInternalLinkage()) {
             // There *MAY* be an edge from the external call node to this
             // function.  If so, remove it.





More information about the llvm-commits mailing list