From 29f4a8d61fb72f069c59c670e737b8f5ba0ef271 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Mon, 28 Apr 2014 22:24:44 +0000 Subject: [PATCH] When Driver::generateCompilationDiagnostics is filtering the list of inputs to the preprocessor, check for invalid types first because not all linker inputs have an option value to retrieve. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207454 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 7 ++++--- test/Driver/crash-report.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index be83713b60..a238e37c1d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -447,13 +447,14 @@ void Driver::generateCompilationDiagnostics(Compilation &C, bool IgnoreInput = false; // Ignore input from stdin or any inputs that cannot be preprocessed. - if (!strcmp(it->second->getValue(), "-")) { + // Check type first as not all linker inputs have a value. + if (types::getPreprocessedType(it->first) == types::TY_INVALID) { + IgnoreInput = true; + } else if (!strcmp(it->second->getValue(), "-")) { Diag(clang::diag::note_drv_command_failed_diag_msg) << "Error generating preprocessed source(s) - ignoring input from stdin" "."; IgnoreInput = true; - } else if (types::getPreprocessedType(it->first) == types::TY_INVALID) { - IgnoreInput = true; } if (IgnoreInput) { diff --git a/test/Driver/crash-report.c b/test/Driver/crash-report.c index acc1abdc4e..59ce8f76a3 100644 --- a/test/Driver/crash-report.c +++ b/test/Driver/crash-report.c @@ -14,7 +14,7 @@ // because of the glob (*.c, *.sh) // REQUIRES: shell -// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null 2>&1 | FileCheck %s +// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s // FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed" // XFAIL: mingw32 -- 2.40.0