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

Chris Lattner lattner at cs.uiuc.edu
Mon Jun 2 12:26:01 PDT 2003


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.42 -> 1.43

---
Log message:

Fix bug: Linker/2003-06-02-TypeResolveProblem.ll


---
Diffs of the changes:

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.42 llvm/lib/VMCore/Constants.cpp:1.43
--- llvm/lib/VMCore/Constants.cpp:1.42	Sun May 25 11:15:32 2003
+++ llvm/lib/VMCore/Constants.cpp	Mon Jun  2 12:25:46 2003
@@ -556,6 +556,7 @@
 void ConstantArray::refineAbstractType(const DerivedType *OldTy,
                                        const Type *NewTy) {
   Value::refineAbstractType(OldTy, NewTy);
+  if (OldTy == NewTy) return;
 
   // Make everyone now use a constant of the new type...
   std::vector<Constant*> C;
@@ -625,6 +626,7 @@
 void ConstantStruct::refineAbstractType(const DerivedType *OldTy,
                                         const Type *NewTy) {
   Value::refineAbstractType(OldTy, NewTy);
+  if (OldTy == NewTy) return;
 
   // Make everyone now use a constant of the new type...
   std::vector<Constant*> C;
@@ -666,6 +668,7 @@
 void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy,
                                              const Type *NewTy) {
   Value::refineAbstractType(OldTy, NewTy);
+  if (OldTy == NewTy) return;
 
   // Make everyone now use a constant of the new type...
   if (NewTy != OldTy) {
@@ -798,6 +801,7 @@
 void ConstantExpr::refineAbstractType(const DerivedType *OldTy,
                                       const Type *NewTy) {
   Value::refineAbstractType(OldTy, NewTy);
+  if (OldTy == NewTy) return;
 
   // FIXME: These need to use a lower-level implementation method, because the
   // ::get methods intuit the type of the result based on the types of the





More information about the llvm-commits mailing list