mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
Use an early return. NFC.
llvm-svn: 223470
This commit is contained in:
parent
c900d55e15
commit
15b21effe3
@ -1028,30 +1028,30 @@ bool ModuleLinker::linkGlobalValueProto(GlobalValue *SGV) {
|
||||
else
|
||||
NewGV = linkGlobalAliasProto(cast<GlobalAlias>(SGV), DGV, LinkFromSrc);
|
||||
|
||||
if (NewGV) {
|
||||
if (NewGV != DGV)
|
||||
copyGVAttributes(NewGV, SGV);
|
||||
if (!NewGV)
|
||||
return false;
|
||||
|
||||
NewGV->setUnnamedAddr(HasUnnamedAddr);
|
||||
NewGV->setVisibility(Visibility);
|
||||
if (NewGV != DGV)
|
||||
copyGVAttributes(NewGV, SGV);
|
||||
|
||||
if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {
|
||||
if (C)
|
||||
NewGO->setComdat(C);
|
||||
NewGV->setUnnamedAddr(HasUnnamedAddr);
|
||||
NewGV->setVisibility(Visibility);
|
||||
|
||||
if (DGV && DGV->hasCommonLinkage() && SGV->hasCommonLinkage())
|
||||
NewGO->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
||||
}
|
||||
|
||||
// Make sure to remember this mapping.
|
||||
if (NewGV != DGV) {
|
||||
if (DGV) {
|
||||
DGV->replaceAllUsesWith(
|
||||
ConstantExpr::getBitCast(NewGV, DGV->getType()));
|
||||
DGV->eraseFromParent();
|
||||
}
|
||||
ValueMap[SGV] = NewGV;
|
||||
if (auto *NewGO = dyn_cast<GlobalObject>(NewGV)) {
|
||||
if (C)
|
||||
NewGO->setComdat(C);
|
||||
|
||||
if (DGV && DGV->hasCommonLinkage() && SGV->hasCommonLinkage())
|
||||
NewGO->setAlignment(std::max(DGV->getAlignment(), SGV->getAlignment()));
|
||||
}
|
||||
|
||||
// Make sure to remember this mapping.
|
||||
if (NewGV != DGV) {
|
||||
if (DGV) {
|
||||
DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGV, DGV->getType()));
|
||||
DGV->eraseFromParent();
|
||||
}
|
||||
ValueMap[SGV] = NewGV;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user