Use an early return. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223470 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-12-05 15:42:30 +00:00
parent c4c08aab64
commit 46cbde27ce

View File

@ -1028,7 +1028,9 @@ bool ModuleLinker::linkGlobalValueProto(GlobalValue *SGV) {
else
NewGV = linkGlobalAliasProto(cast<GlobalAlias>(SGV), DGV, LinkFromSrc);
if (NewGV) {
if (!NewGV)
return false;
if (NewGV != DGV)
copyGVAttributes(NewGV, SGV);
@ -1046,13 +1048,11 @@ bool ModuleLinker::linkGlobalValueProto(GlobalValue *SGV) {
// Make sure to remember this mapping.
if (NewGV != DGV) {
if (DGV) {
DGV->replaceAllUsesWith(
ConstantExpr::getBitCast(NewGV, DGV->getType()));
DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGV, DGV->getType()));
DGV->eraseFromParent();
}
ValueMap[SGV] = NewGV;
}
}
return false;
}