r225614 - Driver: include rewrite maps in the diagnostics
Saleem Abdulrasool
compnerd at compnerd.org
Sun Jan 11 18:33:09 PST 2015
Author: compnerd
Date: Sun Jan 11 20:33:09 2015
New Revision: 225614
URL: http://llvm.org/viewvc/llvm-project?rev=225614&view=rev
Log:
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.
Added:
cfe/trunk/test/Driver/rewrite-map-in-diagnostics.c
Modified:
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=225614&r1=225613&r2=225614&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Sun Jan 11 20:33:09 2015
@@ -548,6 +548,11 @@ void Driver::generateCompilationDiagnost
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********************";
}
Added: cfe/trunk/test/Driver/rewrite-map-in-diagnostics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/rewrite-map-in-diagnostics.c?rev=225614&view=auto
==============================================================================
--- cfe/trunk/test/Driver/rewrite-map-in-diagnostics.c (added)
+++ cfe/trunk/test/Driver/rewrite-map-in-diagnostics.c Sun Jan 11 20:33:09 2015
@@ -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
More information about the cfe-commits
mailing list