]> granicus.if.org Git - clang/commitdiff
Driver: include rewrite maps in the diagnostics
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 12 Jan 2015 02:33:09 +0000 (02:33 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 12 Jan 2015 02:33:09 +0000 (02:33 +0000)
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
test/Driver/rewrite-map-in-diagnostics.c [new file with mode: 0644]

index 68ff98bd6f345bd3b5856c65312b94dd52347333..1664d0d49d46960482943f13c3d9c08b3a589dcf 100644 (file)
@@ -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 (file)
index 0000000..3a3567f
--- /dev/null
@@ -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