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

Chris Lattner lattner at cs.uiuc.edu
Thu Sep 4 18:51:01 PDT 2003


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.63 -> 1.64

---
Log message:

containsEquivalent never returns its argument


---
Diffs of the changes:

Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.63 llvm/lib/VMCore/Type.cpp:1.64
--- llvm/lib/VMCore/Type.cpp:1.63	Thu Sep  4 18:46:03 2003
+++ llvm/lib/VMCore/Type.cpp	Thu Sep  4 18:49:53 2003
@@ -503,7 +503,7 @@
   inline const TypeClass *containsEquivalent(const TypeClass *Ty) {
     for (typename MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
       if (I->second.get() != Ty && TypesEqual(Ty, I->second.get()))
-	return (TypeClass*)I->second.get();  // FIXME TODO when types not const
+	return (TypeClass*)I->second.get();
     return 0;
   }
 
@@ -1065,8 +1065,7 @@
       ParamTys[i] = NewType;
     }
 
-  const FunctionType *MT = FunctionTypes.containsEquivalent(this);
-  if (MT && MT != this) {
+  if (const FunctionType *MT = FunctionTypes.containsEquivalent(this)) {
     refineAbstractTypeTo(MT);            // Different type altogether...
   } else {
     // If the type is currently thought to be abstract, rescan all of our
@@ -1093,8 +1092,7 @@
   ElementType.removeUserFromConcrete();
   ElementType = NewType;
 
-  const ArrayType *AT = ArrayTypes.containsEquivalent(this);
-  if (AT && AT != this) {
+  if (const ArrayType *AT = ArrayTypes.containsEquivalent(this)) {
     refineAbstractTypeTo(AT);          // Different type altogether...
   } else {
     // If the type is currently thought to be abstract, rescan all of our
@@ -1124,8 +1122,7 @@
       ETypes[i] = NewType;
     }
 
-  const StructType *ST = StructTypes.containsEquivalent(this);
-  if (ST && ST != this) {
+  if (const StructType *ST = StructTypes.containsEquivalent(this)) {
     refineAbstractTypeTo(ST);          // Different type altogether...
   } else {
     // If the type is currently thought to be abstract, rescan all of our
@@ -1151,8 +1148,7 @@
   ElementType.removeUserFromConcrete();
   ElementType = NewType;
 
-  const PointerType *PT = PointerTypes.containsEquivalent(this);
-  if (PT && PT != this) {
+  if (const PointerType *PT = PointerTypes.containsEquivalent(this)) {
     refineAbstractTypeTo(PT);          // Different type altogether...
   } else {
     // If the type is currently thought to be abstract, rescan all of our





More information about the llvm-commits mailing list