diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-21 21:52:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-21 21:52:20 +0000 |
commit | 9bc22b7439a44d0bbd8cc77c77a9ec5d5443644b (patch) | |
tree | 0335af8b28ee3bbf28482f48e6d9276d8683fc15 /llvm/lib/Transforms/Utils/Linker.cpp | |
parent | 1e0c213eab3808f9e03a4822202a6fb55a35814c (diff) | |
download | bcm5719-llvm-9bc22b7439a44d0bbd8cc77c77a9ec5d5443644b.tar.gz bcm5719-llvm-9bc22b7439a44d0bbd8cc77c77a9ec5d5443644b.zip |
Fix message to make more sense and confuse Chris less
llvm-svn: 9354
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index bd8ec8c9cef..0e7d887044d 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -463,11 +463,16 @@ static bool LinkGlobals(Module *Dest, const Module *Src, "' have different linkage specifiers!"); } else if (SGV->hasExternalLinkage()) { // Allow linking two exactly identical external global variables... - if (SGV->isConstant() != DGV->isConstant() || - SGV->getInitializer() != DGV->getInitializer()) + if (SGV->isConstant() != DGV->isConstant()) return Error(Err, "Global Variable Collision on '" + SGV->getType()->getDescription() + " %" + SGV->getName() + "' - Global variables differ in const'ness"); + + if (SGV->getInitializer() != DGV->getInitializer()) + return Error(Err, "Global Variable Collision on '" + + SGV->getType()->getDescription() + " %" + SGV->getName() + + "' - External linkage globals have different initializers"); + ValueMap.insert(std::make_pair(SGV, DGV)); } else if (SGV->hasLinkOnceLinkage()) { // If the global variable has a name, and that name is already in use in |