[driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148970 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index 0a14fdd..ad3f350 100644
--- a/tools/driver/cc1_main.cpp
+++ b/tools/driver/cc1_main.cpp
@@ -140,8 +140,6 @@
bool Success;
Success = CompilerInvocation::CreateFromArgs(Clang->getInvocation(),
ArgBegin, ArgEnd, Diags);
- if (!Success)
- return 1;
// Infer the builtin include path if unspecified.
if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&
@@ -160,6 +158,8 @@
static_cast<void*>(&Clang->getDiagnostics()));
DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
+ if (!Success)
+ return 1;
// Execute the frontend actions.
Success = ExecuteCompilerInvocation(Clang.get());