forked from OSchip/llvm-project
parent
54de5be0b4
commit
e06036d229
|
@ -365,6 +365,10 @@ static bool GetLinkageResult(GlobalValue *Dest, GlobalValue *Src,
|
||||||
LinkFromSrc = true;
|
LinkFromSrc = true;
|
||||||
LT = Src->getLinkage();
|
LT = Src->getLinkage();
|
||||||
}
|
}
|
||||||
|
} else if (Dest->hasExternalWeakLinkage()) {
|
||||||
|
//If the Dest is weak, use the source linkage
|
||||||
|
LinkFromSrc = true;
|
||||||
|
LT = Src->getLinkage();
|
||||||
} else {
|
} else {
|
||||||
LinkFromSrc = false;
|
LinkFromSrc = false;
|
||||||
LT = Dest->getLinkage();
|
LT = Dest->getLinkage();
|
||||||
|
@ -446,7 +450,7 @@ static bool LinkGlobals(Module *Dest, Module *Src,
|
||||||
if (DGV && DGV->hasInternalLinkage())
|
if (DGV && DGV->hasInternalLinkage())
|
||||||
DGV = 0;
|
DGV = 0;
|
||||||
|
|
||||||
assert(SGV->hasInitializer() ||
|
assert(SGV->hasInitializer() || SGV->hasExternalWeakLinkage() ||
|
||||||
SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage() &&
|
SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage() &&
|
||||||
"Global must either be external or have an initializer!");
|
"Global must either be external or have an initializer!");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue