linkGlobalVariableProto never returns null. Simplify the caller. NFC.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 5 Dec 2014 00:30:47 +0000 (00:30 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 5 Dec 2014 00:30:47 +0000 (00:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223424 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index 738791d7e5691378abe0af6c9b3a76ad6ab04ee8..5b2d425c805dd2a21b253fa43968a7c35a271e04 100644 (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)