summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2014-01-14 12:38:32 +0000
committerNico Rieck <nico.rieck@gmail.com>2014-01-14 12:38:32 +0000
commit9d2e0df0493e4085c556abf5c5433ca06f43008d (patch)
tree110f2fc9cfeb00483a6923c732a5c9b41d11e7f9 /llvm/lib/Linker
parent1794b62f5467d1e795167c4417c82a3d9c05cec2 (diff)
downloadbcm5719-llvm-9d2e0df0493e4085c556abf5c5433ca06f43008d.tar.gz
bcm5719-llvm-9d2e0df0493e4085c556abf5c5433ca06f43008d.zip
Revert "Decouple dllexport/dllimport from linkage"
Revert this for now until I fix an issue in Clang with it. This reverts commit r199204. llvm-svn: 199207
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 4d039eb2c6d..8f2200e4ea2 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -543,8 +543,8 @@ bool ModuleLinker::getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
if (SrcIsDeclaration) {
// If Src is external or if both Src & Dest are external.. Just link the
// external globals, we aren't adding anything.
- if (Src->hasDLLImportStorageClass()) {
- // If one of GVs is marked as DLLImport, result should be dllimport'ed.
+ if (Src->hasDLLImportLinkage()) {
+ // If one of GVs has DLLImport linkage, result should be dllimport'ed.
if (DestIsDeclaration) {
LinkFromSrc = true;
LT = Src->getLinkage();
@@ -557,7 +557,7 @@ bool ModuleLinker::getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
LinkFromSrc = false;
LT = Dest->getLinkage();
}
- } else if (DestIsDeclaration && !Dest->hasDLLImportStorageClass()) {
+ } else if (DestIsDeclaration && !Dest->hasDLLImportLinkage()) {
// If Dest is external but Src is not:
LinkFromSrc = true;
LT = Src->getLinkage();
@@ -584,8 +584,10 @@ bool ModuleLinker::getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
LT = GlobalValue::ExternalLinkage;
}
} else {
- assert((Dest->hasExternalLinkage() || Dest->hasExternalWeakLinkage()) &&
- (Src->hasExternalLinkage() || Src->hasExternalWeakLinkage()) &&
+ assert((Dest->hasExternalLinkage() || Dest->hasDLLImportLinkage() ||
+ Dest->hasDLLExportLinkage() || Dest->hasExternalWeakLinkage()) &&
+ (Src->hasExternalLinkage() || Src->hasDLLImportLinkage() ||
+ Src->hasDLLExportLinkage() || Src->hasExternalWeakLinkage()) &&
"Unexpected linkage type!");
return emitError("Linking globals named '" + Src->getName() +
"': symbol multiply defined!");
OpenPOWER on IntegriCloud