[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 17 15:57:02 PST 2004
Changes in directory llvm/lib/Transforms/Utils:
Linker.cpp updated: 1.67 -> 1.68
---
Log message:
Fix PR245: Linking weak and strong global variables is dependent on link order
---
Diffs of the changes: (+3 -1)
Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.67 llvm/lib/Transforms/Utils/Linker.cpp:1.68
--- llvm/lib/Transforms/Utils/Linker.cpp:1.67 Sat Feb 14 23:55:12 2004
+++ llvm/lib/Transforms/Utils/Linker.cpp Tue Feb 17 15:56:04 2004
@@ -566,13 +566,15 @@
GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[SGV]);
if (DGV->hasInitializer()) {
- assert(SGV->getLinkage() == DGV->getLinkage());
if (SGV->hasExternalLinkage()) {
if (DGV->getInitializer() != SInit)
return Error(Err, "Global Variable Collision on '" +
SGV->getType()->getDescription() +"':%"+SGV->getName()+
" - Global variables have different initializers");
} else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage()) {
+ // Nothing is required, mapped values will take the new global
+ // automatically.
+ } else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage()) {
// Nothing is required, mapped values will take the new global
// automatically.
} else if (DGV->hasAppendingLinkage()) {
More information about the llvm-commits
mailing list