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

Chris Lattner lattner at cs.uiuc.edu
Sat May 31 15:45:00 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

FunctionResolution.cpp updated: 1.28 -> 1.29

---
Log message:

Simplify funcresolve a bit more


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp
diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.28 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.29
--- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.28	Sat May 31 15:33:31 2003
+++ llvm/lib/Transforms/IPO/FunctionResolution.cpp	Sat May 31 15:44:46 2003
@@ -183,18 +183,18 @@
             Changed = true;
             ++NumResolved;
           } else {
-            std::cerr << "Couldn't cleanup this function call, must be an"
-                      << " argument or something!" << CI;
             ++i;
           }
-        } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(U)) {
-          Constant *NewCPR = ConstantPointerRef::get(Concrete);
-          CPR->replaceAllUsesWith(ConstantExpr::getCast(NewCPR,CPR->getType()));
-          CPR->destroyConstant();
         } else {
-          std::cerr << "Cannot convert use of function: " << U << "\n";
           ++i;
         }
+      }
+
+      // If there are any more uses that we could not resolve, force them to use
+      // a casted pointer now.
+      if (!Old->use_empty()) {
+        Constant *NewCPR = ConstantPointerRef::get(Concrete);
+        Old->replaceAllUsesWith(ConstantExpr::getCast(NewCPR, Old->getType()));
       }
     }
   return Changed;





More information about the llvm-commits mailing list