mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[lib/LTO] Don't reinvent the code for switching linkage.
Differential Revision: https://reviews.llvm.org/D33582 llvm-svn: 304040
This commit is contained in:
parent
4d8b3e20c7
commit
afaa7cc982
@ -542,16 +542,10 @@ Error LTO::addRegularLTO(BitcodeModule BM,
|
||||
if (Sym.isUndefined())
|
||||
continue;
|
||||
Keep.push_back(GV);
|
||||
switch (GV->getLinkage()) {
|
||||
default:
|
||||
break;
|
||||
case GlobalValue::LinkOnceAnyLinkage:
|
||||
GV->setLinkage(GlobalValue::WeakAnyLinkage);
|
||||
break;
|
||||
case GlobalValue::LinkOnceODRLinkage:
|
||||
GV->setLinkage(GlobalValue::WeakODRLinkage);
|
||||
break;
|
||||
}
|
||||
GlobalValue::LinkageTypes OriginalLinkage = GV->getLinkage();
|
||||
if (GlobalValue::isLinkOnceLinkage(OriginalLinkage))
|
||||
GV->setLinkage(GlobalValue::getWeakLinkage(
|
||||
GlobalValue::isLinkOnceODRLinkage(OriginalLinkage)));
|
||||
} else if (isa<GlobalObject>(GV) &&
|
||||
(GV->hasLinkOnceODRLinkage() || GV->hasWeakODRLinkage() ||
|
||||
GV->hasAvailableExternallyLinkage()) &&
|
||||
|
Loading…
Reference in New Issue
Block a user