[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 21 16:53:01 PDT 2003
Changes in directory llvm/lib/Transforms/Utils:
Linker.cpp updated: 1.57 -> 1.58
---
Log message:
Fix message to make more sense and confuse Chris less
---
Diffs of the changes: (+7 -2)
Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.57 llvm/lib/Transforms/Utils/Linker.cpp:1.58
--- llvm/lib/Transforms/Utils/Linker.cpp:1.57 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/Linker.cpp Tue Oct 21 16:52:20 2003
@@ -463,11 +463,16 @@
"' 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
More information about the llvm-commits
mailing list