code; and don't return an error code when -### is present, even if
errors occur.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67425
91177308-0d34-0410-b5e6-
96231b3b80d8
const OptTable &getOpts() const { return *Opts; }
+ const Diagnostic &getDiags() const { return Diags; }
+
/// @}
/// @name Primary Functionality
/// @{
return 0;
}
+ // If there were errors building the compilation, quit now.
+ if (getDriver().getDiags().getNumErrors())
+ return 1;
+
int Res = ExecuteJob(Jobs);
// Remove temp files.
llvm::OwningPtr<Compilation> C(TheDriver->BuildCompilation(argc, argv));
- // If there were errors building the compilation, quit now.
- if (Diags.getNumErrors())
- return 1;
- if (!C.get())
- return 0;
-
- int res = C->Execute();
+ int Res = 0;
+ if (C.get())
+ Res = C->Execute();
llvm::llvm_shutdown();
- return res;
+ return Res;
}