From bdb1b08f6545d85d6d5f492f544cd864ab5fe733 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 12 Jan 2015 02:33:09 +0000 Subject: [PATCH] Driver: include rewrite maps in the diagnostics The rewrite map files are not copied, and so cannot be tracked as temporary files. Add them explicitly to the list of files that we request from the user to be attached to bug reports. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225614 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 5 +++++ test/Driver/rewrite-map-in-diagnostics.c | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/Driver/rewrite-map-in-diagnostics.c diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 68ff98bd6f..1664d0d49d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -548,6 +548,11 @@ void Driver::generateCompilationDiagnostics(Compilation &C, Cmd.Print(ScriptOS, "\n", /*Quote=*/true, &CrashInfo); Diag(clang::diag::note_drv_command_failed_diag_msg) << Script; } + + for (const auto &A : C.getArgs().filtered(options::OPT_frewrite_map_file, + options::OPT_frewrite_map_file_EQ)) + Diag(clang::diag::note_drv_command_failed_diag_msg) << A->getValue(); + Diag(clang::diag::note_drv_command_failed_diag_msg) << "\n\n********************"; } diff --git a/test/Driver/rewrite-map-in-diagnostics.c b/test/Driver/rewrite-map-in-diagnostics.c new file mode 100644 index 0000000000..3a3567fb1b --- /dev/null +++ b/test/Driver/rewrite-map-in-diagnostics.c @@ -0,0 +1,9 @@ +// RUN: rm -rf "%t" +// RUN: mkdir -p "%t" +// RUN: not env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTION=1 \ +// RUN: %clang -fsyntax-only -frewrite-map-file %p/Inputs/rewrite.map %s 2>&1 \ +// RUN: | FileCheck %s + +#pragma clang __debug parser_crash + +// CHECK: note: diagnostic msg: {{.*}}rewrite.map -- 2.50.1