llvm.org GIT mirror llvm / aeb18ce
Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9357 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
3 changed file(s) with 30 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
214214 }
215215
216216 // If we STILL cannot resolve the types, then there is something wrong.
217 // Report the error.
217 // Report the warning and delete one of the names.
218218 if (DelayedTypesToResolve.size() == OldSize) {
219 // Build up an error message of all of the mismatched types.
220 std::string ErrorMessage;
221 for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) {
222 const std::string &Name = DelayedTypesToResolve[i];
223 const Type *T1 = cast(VM.find(Name)->second);
224 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
225 ErrorMessage += " Type named '" + Name +
226 "' conflicts.\n Src='" + T1->getDescription() +
227 "'.\n Dest='" + T2->getDescription() + "'\n";
228 }
229 return Error(Err, "Type conflict between types in modules:\n" +
230 ErrorMessage);
219 const std::string &Name = DelayedTypesToResolve.back();
220
221 const Type *T1 = cast(VM.find(Name)->second);
222 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
223 std::cerr << "WARNING: Type conflict between types named '" << Name
224 << "'.\n Src='" << *T1 << "'.\n Dest='" << *T2 << "'\n";
225
226 // Remove the symbol name from the destination.
227 DelayedTypesToResolve.pop_back();
231228 }
232229 }
233230 }
214214 }
215215
216216 // If we STILL cannot resolve the types, then there is something wrong.
217 // Report the error.
217 // Report the warning and delete one of the names.
218218 if (DelayedTypesToResolve.size() == OldSize) {
219 // Build up an error message of all of the mismatched types.
220 std::string ErrorMessage;
221 for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) {
222 const std::string &Name = DelayedTypesToResolve[i];
223 const Type *T1 = cast(VM.find(Name)->second);
224 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
225 ErrorMessage += " Type named '" + Name +
226 "' conflicts.\n Src='" + T1->getDescription() +
227 "'.\n Dest='" + T2->getDescription() + "'\n";
228 }
229 return Error(Err, "Type conflict between types in modules:\n" +
230 ErrorMessage);
219 const std::string &Name = DelayedTypesToResolve.back();
220
221 const Type *T1 = cast(VM.find(Name)->second);
222 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
223 std::cerr << "WARNING: Type conflict between types named '" << Name
224 << "'.\n Src='" << *T1 << "'.\n Dest='" << *T2 << "'\n";
225
226 // Remove the symbol name from the destination.
227 DelayedTypesToResolve.pop_back();
231228 }
232229 }
233230 }
214214 }
215215
216216 // If we STILL cannot resolve the types, then there is something wrong.
217 // Report the error.
217 // Report the warning and delete one of the names.
218218 if (DelayedTypesToResolve.size() == OldSize) {
219 // Build up an error message of all of the mismatched types.
220 std::string ErrorMessage;
221 for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) {
222 const std::string &Name = DelayedTypesToResolve[i];
223 const Type *T1 = cast(VM.find(Name)->second);
224 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
225 ErrorMessage += " Type named '" + Name +
226 "' conflicts.\n Src='" + T1->getDescription() +
227 "'.\n Dest='" + T2->getDescription() + "'\n";
228 }
229 return Error(Err, "Type conflict between types in modules:\n" +
230 ErrorMessage);
219 const std::string &Name = DelayedTypesToResolve.back();
220
221 const Type *T1 = cast(VM.find(Name)->second);
222 const Type *T2 = cast(DestST->lookup(Type::TypeTy, Name));
223 std::cerr << "WARNING: Type conflict between types named '" << Name
224 << "'.\n Src='" << *T1 << "'.\n Dest='" << *T2 << "'\n";
225
226 // Remove the symbol name from the destination.
227 DelayedTypesToResolve.pop_back();
231228 }
232229 }
233230 }