зеркало из https://github.com/microsoft/clang-1.git
[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
This commit is contained in:
Родитель
60a09dcc46
Коммит
ada4fa7978
|
@ -0,0 +1,4 @@
|
|||
// RUN: not %clang_cc1 %s -cake-is-lie 2> %t.log
|
||||
// RUN: FileCheck %s -input-file=%t.log
|
||||
|
||||
// CHECK: unknown argument
|
|
@ -140,8 +140,6 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
|
|||
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 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
|
|||
static_cast<void*>(&Clang->getDiagnostics()));
|
||||
|
||||
DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
|
||||
if (!Success)
|
||||
return 1;
|
||||
|
||||
// Execute the frontend actions.
|
||||
Success = ExecuteCompilerInvocation(Clang.get());
|
||||
|
|
Загрузка…
Ссылка в новой задаче