aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-15 02:37:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-15 02:37:43 +0000
commit70d3c92820f590b10553da9c96eda24e4325ba34 (patch)
tree634650db518f65e9bf546e9eb23f430ab8de8503
parentdb600c330a37b1c3ab4533310729910ee188f900 (diff)
Driver: For clang, accept -fsigned-bitfields and reject
-funsigned-bitfields for now (clang defaults to -fsigned-bitfields). - <rdar://problem/6790309> ER: Support -fsigned-bitfields/-funsigned-bitfields git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69131 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Options.def2
-rw-r--r--lib/Driver/Tools.cpp7
2 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def
index a9074e88f0..1083794414 100644
--- a/include/clang/Driver/Options.def
+++ b/include/clang/Driver/Options.def
@@ -498,6 +498,7 @@ OPTION("-fprint-source-range-info", fprint_source_range_info, Flag, f_Group, INV
OPTION("-fprofile-arcs", fprofile_arcs, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fprofile-generate", fprofile_generate, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 0, 0, 0)
+OPTION("-fsigned-bitfields", fsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fstack-protector", fstack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
OPTION("-fstrict-aliasing", fstrict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0)
OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0)
@@ -506,6 +507,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("-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)
OPTION("-fvisibility=", fvisibility_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 7c73780036..c266cc2172 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -473,6 +473,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (!Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common))
CmdArgs.push_back("-fno-common");
+ // -fsigned-bitfields is default, and clang doesn't yet support
+ // --funsigned-bitfields.
+ if (!Args.hasFlag(options::OPT_fsigned_bitfields,
+ options::OPT_funsigned_bitfields))
+ D.Diag(clang::diag::warn_drv_clang_unsupported)
+ << Args.getLastArg(options::OPT_funsigned_bitfields)->getAsString(Args);
+
Args.AddLastArg(CmdArgs, options::OPT_dM);
Args.AddLastArg(CmdArgs, options::OPT_dD);