[cfe-commits] r129086 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Driver/CC1Options.td include/clang/Frontend/DiagnosticOptions.h lib/Frontend/CompilerInvocation.cpp

Daniel Dunbar daniel at zuster.org
Thu Apr 7 11:11:14 PDT 2011


Author: ddunbar
Date: Thu Apr  7 13:11:14 2011
New Revision: 129086

URL: http://llvm.org/viewvc/llvm-project?rev=129086&view=rev
Log:
Frontend: Sketch support for -diagnostic-log-file, which still doesn't do anything.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Frontend/DiagnosticOptions.h
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=129086&r1=129085&r2=129086&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Thu Apr  7 13:11:14 2011
@@ -79,7 +79,7 @@
     "macro '%0' contains embedded newline, text after the newline is ignored.">;
 def warn_fe_cc_print_header_failure : Warning<
     "unable to open CC_PRINT_HEADERS file: %0 (using stderr)">;
-def warn_fe_cc_log_diagnositcs_failure : Warning<
+def warn_fe_cc_log_diagnostics_failure : Warning<
     "unable to open CC_LOG_DIAGNOSTICS file: %0 (using stderr)">;
 
 def err_verify_missing_start : Error<

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=129086&r1=129085&r2=129086&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Thu Apr  7 13:11:14 2011
@@ -201,6 +201,8 @@
 def dump_build_information : Separate<"-dump-build-information">,
   MetaVarName<"<filename>">,
   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 fno_show_column : Flag<"-fno-show-column">,
   HelpText<"Do not include column number on diagnostics">;
 def fno_show_source_location : Flag<"-fno-show-source-location">,

Modified: cfe/trunk/include/clang/Frontend/DiagnosticOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/DiagnosticOptions.h?rev=129086&r1=129085&r2=129086&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/DiagnosticOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/DiagnosticOptions.h Thu Apr  7 13:11:14 2011
@@ -61,6 +61,9 @@
   /// testing and analysis.
   std::string DumpBuildInformation;
 
+  /// The file to log diagnostic output to.
+  std::string DiagnosticLogFile;
+
   /// The list of -W... options used to alter the diagnostic mappings, with the
   /// prefixes removed.
   std::vector<std::string> Warnings;

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=129086&r1=129085&r2=129086&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Apr  7 13:11:14 2011
@@ -273,6 +273,10 @@
     Res.push_back("-ferror-limit");
     Res.push_back(llvm::utostr(Opts.ErrorLimit));
   }
+  if (!Opts.DiagnosticLogFile.empty()) {
+    Res.push_back("-diagnostic-log-file");
+    Res.push_back(Opts.DiagnosticLogFile);
+  }
   if (Opts.MacroBacktraceLimit
                         != DiagnosticOptions::DefaultMacroBacktraceLimit) {
     Res.push_back("-fmacro-backtrace-limit");
@@ -981,6 +985,7 @@
 static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
                                 Diagnostic &Diags) {
   using namespace cc1options;
+  Opts.DiagnosticLogFile = Args.getLastArgValue(OPT_diagnostic_log_file);
   Opts.IgnoreWarnings = Args.hasArg(OPT_w);
   Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros);
   Opts.Pedantic = Args.hasArg(OPT_pedantic);





More information about the cfe-commits mailing list