[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 21 17:47:01 PDT 2003


Changes in directory llvm/lib/Transforms/Utils:

Linker.cpp updated: 1.58 -> 1.59

---
Log message:

Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll


---
Diffs of the changes:  (+10 -13)

Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.58 llvm/lib/Transforms/Utils/Linker.cpp:1.59
--- llvm/lib/Transforms/Utils/Linker.cpp:1.58	Tue Oct 21 16:52:20 2003
+++ llvm/lib/Transforms/Utils/Linker.cpp	Tue Oct 21 17:46:38 2003
@@ -215,20 +215,17 @@
       }
 
       // If we STILL cannot resolve the types, then there is something wrong.
-      // Report the error.
+      // Report the warning and delete one of the names.
       if (DelayedTypesToResolve.size() == OldSize) {
-        // Build up an error message of all of the mismatched types.
-        std::string ErrorMessage;
-        for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) {
-          const std::string &Name = DelayedTypesToResolve[i];
-          const Type *T1 = cast<Type>(VM.find(Name)->second);
-          const Type *T2 = cast<Type>(DestST->lookup(Type::TypeTy, Name));
-          ErrorMessage += "  Type named '" + Name + 
-                          "' conflicts.\n    Src='" + T1->getDescription() +
-                          "'.\n   Dest='" + T2->getDescription() + "'\n";
-        }
-        return Error(Err, "Type conflict between types in modules:\n" +
-                     ErrorMessage);
+        const std::string &Name = DelayedTypesToResolve.back();
+        
+        const Type *T1 = cast<Type>(VM.find(Name)->second);
+        const Type *T2 = cast<Type>(DestST->lookup(Type::TypeTy, Name));
+        std::cerr << "WARNING: Type conflict between types named '" << Name
+                  <<  "'.\n    Src='" << *T1 << "'.\n   Dest='" << *T2 << "'\n";
+
+        // Remove the symbol name from the destination.
+        DelayedTypesToResolve.pop_back();
       }
     }
   }





More information about the llvm-commits mailing list