[cfe-commits] r72272 - in /cfe/trunk: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Options.def lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Fri May 22 12:02:20 PDT 2009


Author: ddunbar
Date: Fri May 22 14:02:20 2009
New Revision: 72272

URL: http://llvm.org/viewvc/llvm-project?rev=72272&view=rev
Log:
Don't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
 - We could just warn about -fno-unit-at-a-time, but in practice people using it
   probably aren't going to get what they want out of clang.

Also, use "clang" specified error for unsupported things instead of driver
unsupported error.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/trunk/include/clang/Driver/Options.def
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=72272&r1=72271&r2=72272&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Fri May 22 14:02:20 2009
@@ -43,6 +43,8 @@
   "invalid version number in '%0'">;
 def err_drv_no_linker_llvm_support : Error<
   "'%0': unable to pass LLVM bit-code files to linker">;
+def err_drv_clang_unsupported : Error<
+  "the clang compiler does not support '%0'">;
 
 def warn_drv_input_file_unused : Warning<
   "%0: '%1' input unused when '%2' is present">;
@@ -57,6 +59,6 @@
 def warn_drv_not_using_clang_arch : Warning<
   "not using the clang compiler for the '%0' architecture">;
 def warn_drv_clang_unsupported : Warning<
-  "the clang compiler does not yet support '%0'">;
+  "the clang compiler does not support '%0'">;
 
 }

Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=72272&r1=72271&r2=72272&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Fri May 22 14:02:20 2009
@@ -415,6 +415,7 @@
 OPTION("-fno-show-column", fno_show_column, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fno-stack-protector", fno_stack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fno-strict-aliasing", fno_strict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
+OPTION("-fno-unit-at-a-time", fno_unit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fno-unwind-tables", fno_unwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fno-working-directory", fno_working_directory, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fno-zero-initialized-in-bss", fno_zero_initialized_in_bss, Flag, f_Group, INVALID, "", 0, 0, 0)
@@ -447,6 +448,7 @@
 OPTION("-ftime-report", ftime_report, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-ftraditional", ftraditional, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-ftrapv", ftrapv, Flag, f_Group, INVALID, "", 0, 0, 0)
+OPTION("-funit-at-a-time", funit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-funsigned-bitfields", funsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-funwind-tables", funwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0)
 OPTION("-fverbose-asm", fverbose_asm, Flag, f_Group, INVALID, "", 0, 0, 0)

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=72272&r1=72271&r2=72272&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri May 22 14:02:20 2009
@@ -399,7 +399,7 @@
   if ((Unsupported = Args.getLastArg(options::OPT_MG)) ||
       (Unsupported = Args.getLastArg(options::OPT_MQ)) ||
       (Unsupported = Args.getLastArg(options::OPT_iframework)))
-    D.Diag(clang::diag::err_drv_unsupported_opt)
+    D.Diag(clang::diag::err_drv_clang_unsupported)
       << Unsupported->getOption().getName();
 
   Args.AddAllArgs(CmdArgs, options::OPT_v);
@@ -549,6 +549,14 @@
       CmdArgs.push_back("-fdollars-in-identifiers=0");
   }
 
+  // -funit-at-a-time is default, and we don't support -fno-unit-at-a-time for
+  // practical purposes.
+  if (Arg *A = Args.getLastArg(options::OPT_funit_at_a_time, 
+                               options::OPT_fno_unit_at_a_time)) {
+    if (A->getOption().matches(options::OPT_fno_unit_at_a_time))
+      D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args);
+  }
+  
   Args.AddLastArg(CmdArgs, options::OPT_dM);
   Args.AddLastArg(CmdArgs, options::OPT_dD);
 





More information about the cfe-commits mailing list