]> granicus.if.org Git - clang/commitdiff
Add top-level driver option '--serialize-diagnostics' for serialize compiler diagnost...
authorTed Kremenek <kremenek@apple.com>
Fri, 11 Nov 2011 00:07:43 +0000 (00:07 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 11 Nov 2011 00:07:43 +0000 (00:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144339 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp

index e8d06f994fde663c444d3ca268a9a6995a2d4389..882805bc2fc0eac9dd7977122403cc0d940bb27d 100644 (file)
@@ -232,7 +232,7 @@ def dump_build_information : Separate<"-dump-build-information">,
   HelpText<"output a dump of some build information to a file">;
 def diagnostic_log_file : Separate<"-diagnostic-log-file">,
   HelpText<"Filename (or -) to log diagnostics to">;
-def diagnostic_serialized_file : Separate<"-diagnostic-serialized-file">,
+def diagnostic_serialized_file : Separate<"-serialize-diagnostic-file">,
   MetaVarName<"<filename>">,
   HelpText<"File for serializing diagnostics in a binary format">;
 def fno_show_column : Flag<"-fno-show-column">,
index 68d132dc17e78aa2c7b8496dbe0ec8f93bbb466e..1e2274a8b7ae1f20967adc5b8ce765ef331b71f4 100644 (file)
@@ -846,6 +846,8 @@ def _relocatable_pch : Flag<"--relocatable-pch">,
 def _resource_EQ : Joined<"--resource=">, Alias<fcompile_resource_EQ>;
 def _resource : Separate<"--resource">, Alias<fcompile_resource_EQ>;
 def _save_temps : Flag<"--save-temps">, Alias<save_temps>;
+def _serialize_diags : Separate<"--serialize-diagnostics">, Flags<[DriverOption]>,
+  HelpText<"Serialize compiler diagnostics to a file">;
 def _shared : Flag<"--shared">, Alias<shared>;
 def _signed_char : Flag<"--signed-char">, Alias<fsigned_char>;
 def _specs_EQ : Joined<"--specs=">, Alias<specs_EQ>;
index 6576fcae3e4280d78112fc90fc776c668faf84d7..9faac7174ac3fe55d1a4411d1d9a7a68bebdd722 100644 (file)
@@ -2213,6 +2213,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   Args.AddLastArg(CmdArgs, options::OPT_dM);
   Args.AddLastArg(CmdArgs, options::OPT_dD);
+  
+  // Handle serialized diagnostics.
+  if (Arg *A = Args.getLastArg(options::OPT__serialize_diags)) {
+    CmdArgs.push_back("-serialize-diagnostic-file");
+    CmdArgs.push_back(Args.MakeArgString(A->getValue(Args)));
+  }
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.