From de2d08ea17efe062799221dcf2432ee0887bede3 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 26 Aug 2014 18:03:35 +0000 Subject: [PATCH] Invert the condition to have a single return. Thanks to David Blaikie for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216468 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-link/llvm-link.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 6ac10d8dcda..17866a06713 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -63,11 +63,10 @@ loadFile(const char *argv0, const std::string &FN, LLVMContext &Context) { SMDiagnostic Err; if (Verbose) errs() << "Loading '" << FN << "'\n"; std::unique_ptr Result = parseIRFile(FN, Err, Context); - if (Result) - return Result; + if (!Result) + Err.print(argv0, errs()); - Err.print(argv0, errs()); - return nullptr; + return Result; } int main(int argc, char **argv) { -- 2.34.1