linkGlobalVariableProto never returns null. Simplify the caller. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223424 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-12-05 00:30:47 +00:00
parent 52978c2adf
commit 7eaee304ab

View File

@ -1021,15 +1021,12 @@ bool ModuleLinker::linkGlobalValueProto(GlobalValue *SGV) {
return false;
GlobalValue *NewGV;
if (auto *SGVar = dyn_cast<GlobalVariable>(SGV)) {
if (auto *SGVar = dyn_cast<GlobalVariable>(SGV))
NewGV = linkGlobalVariableProto(SGVar, DGV, LinkFromSrc);
if (!NewGV)
return true;
} else if (auto *SF = dyn_cast<Function>(SGV)) {
else if (auto *SF = dyn_cast<Function>(SGV))
NewGV = linkFunctionProto(SF, DGV, LinkFromSrc);
} else {
else
NewGV = linkGlobalAliasProto(cast<GlobalAlias>(SGV), DGV, LinkFromSrc);
}
if (NewGV) {
if (NewGV != DGV)