From 7eaee304abe6320924fc55821c7b9548656c43b5 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 5 Dec 2014 00:30:47 +0000 Subject: [PATCH] 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 --- lib/Linker/LinkModules.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 738791d7e56..5b2d425c805 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1021,15 +1021,12 @@ bool ModuleLinker::linkGlobalValueProto(GlobalValue *SGV) { return false; GlobalValue *NewGV; - if (auto *SGVar = dyn_cast(SGV)) { + if (auto *SGVar = dyn_cast(SGV)) NewGV = linkGlobalVariableProto(SGVar, DGV, LinkFromSrc); - if (!NewGV) - return true; - } else if (auto *SF = dyn_cast(SGV)) { + else if (auto *SF = dyn_cast(SGV)) NewGV = linkFunctionProto(SF, DGV, LinkFromSrc); - } else { + else NewGV = linkGlobalAliasProto(cast(SGV), DGV, LinkFromSrc); - } if (NewGV) { if (NewGV != DGV)