diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-10-21 22:46:38 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-10-21 22:46:38 +0000 |
| commit | 4f2581f828b23854ba62fca09c8bbcf69a4616ab (patch) | |
| tree | 4654a79061a2ab4055188e123045c5605d009855 /llvm/lib | |
| parent | 1de1483e385127bcfcfdeba19252777a68ff3a21 (diff) | |
| download | bcm5719-llvm-4f2581f828b23854ba62fca09c8bbcf69a4616ab.tar.gz bcm5719-llvm-4f2581f828b23854ba62fca09c8bbcf69a4616ab.zip | |
Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll
llvm-svn: 9357
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 0e7d887044d..1d002c5821b 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -215,20 +215,17 @@ static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) { } // 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(); } } } |

