[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Fri Dec 15 09:35:52 PST 2006
Changes in directory llvm/lib/Linker:
LinkModules.cpp updated: 1.123 -> 1.124
---
Log message:
extern_weak linkage. fixes PR1038: http://llvm.org/PR1038
---
Diffs of the changes: (+5 -1)
LinkModules.cpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
Index: llvm/lib/Linker/LinkModules.cpp
diff -u llvm/lib/Linker/LinkModules.cpp:1.123 llvm/lib/Linker/LinkModules.cpp:1.124
--- llvm/lib/Linker/LinkModules.cpp:1.123 Mon Dec 11 23:04:59 2006
+++ llvm/lib/Linker/LinkModules.cpp Fri Dec 15 11:35:32 2006
@@ -365,6 +365,10 @@
LinkFromSrc = true;
LT = Src->getLinkage();
}
+ } else if (Dest->hasExternalWeakLinkage()) {
+ //If the Dest is weak, use the source linkage
+ LinkFromSrc = true;
+ LT = Src->getLinkage();
} else {
LinkFromSrc = false;
LT = Dest->getLinkage();
@@ -446,7 +450,7 @@
if (DGV && DGV->hasInternalLinkage())
DGV = 0;
- assert(SGV->hasInitializer() ||
+ assert(SGV->hasInitializer() || SGV->hasExternalWeakLinkage() ||
SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage() &&
"Global must either be external or have an initializer!");
More information about the llvm-commits
mailing list