[llvm] r216468 - Invert the condition to have a single return.
Rafael Espindola
rafael.espindola at gmail.com
Tue Aug 26 11:03:36 PDT 2014
Author: rafael
Date: Tue Aug 26 13:03:35 2014
New Revision: 216468
URL: http://llvm.org/viewvc/llvm-project?rev=216468&view=rev
Log:
Invert the condition to have a single return.
Thanks to David Blaikie for the suggestion.
Modified:
llvm/trunk/tools/llvm-link/llvm-link.cpp
Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=216468&r1=216467&r2=216468&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-link/llvm-link.cpp (original)
+++ llvm/trunk/tools/llvm-link/llvm-link.cpp Tue Aug 26 13:03:35 2014
@@ -63,11 +63,10 @@ loadFile(const char *argv0, const std::s
SMDiagnostic Err;
if (Verbose) errs() << "Loading '" << FN << "'\n";
std::unique_ptr<Module> 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) {
More information about the llvm-commits
mailing list