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
This commit is contained in:
Rafael Espindola 2014-08-26 18:03:35 +00:00
parent 81e49922a8
commit de2d08ea17

View File

@ -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<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) {