[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun May 25 11:16:00 PDT 2003


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.41 -> 1.42

---
Log message:

Fix problem with last checkin.



---
Diffs of the changes:

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.41 llvm/lib/VMCore/Constants.cpp:1.42
--- llvm/lib/VMCore/Constants.cpp:1.41	Fri May 23 15:03:32 2003
+++ llvm/lib/VMCore/Constants.cpp	Sun May 25 11:15:32 2003
@@ -668,10 +668,12 @@
   Value::refineAbstractType(OldTy, NewTy);
 
   // Make everyone now use a constant of the new type...
-  replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
-  
-  // This constant is now dead, destroy it.
-  destroyConstant();
+  if (NewTy != OldTy) {
+    replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
+    
+    // This constant is now dead, destroy it.
+    destroyConstant();
+  }
 }
 
 





More information about the llvm-commits mailing list