aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-22 19:02:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-22 19:02:20 +0000
commite027a4b2399e9b0acfe0f77220c66bbe369067ee (patch)
tree26ff451e1ca402679cee06bc78ea2ebfe1e01e0d
parent3a5f5c57e0a262207f7cb721a60df3676ab5209f (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72272 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td4
-rw-r--r--include/clang/Driver/Options.def2
-rw-r--r--lib/Driver/Tools.cpp10
3 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td
index 8a0616ba6d..327db00e0b 100644
--- a/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/include/clang/Basic/DiagnosticDriverKinds.td
@@ -43,6 +43,8 @@ def err_drv_invalid_version_number : Error<
"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_cxx : Warning<
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'">;
}
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def
index 90258ef77e..2ec2336c8d 100644
--- a/include/clang/Driver/Options.def
+++ b/include/clang/Driver/Options.def
@@ -415,6 +415,7 @@ OPTION("-fno-pascal-strings", fno_pascal_strings, Flag, f_Group, INVALID, "", 0,
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("-fterminated-vtables", fterminated_vtables, Flag, f_Group, INVALID, "",
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)
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 91e39dda00..fd071dfe28 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -399,7 +399,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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);