[cfe-commits] r72930 - in /cfe/trunk: include/clang/Driver/Options.def lib/Driver/Tools.cpp
Eli Friedman
eli.friedman at gmail.com
Fri Jun 5 00:21:14 PDT 2009
Author: efriedma
Date: Fri Jun 5 02:21:14 2009
New Revision: 72930
URL: http://llvm.org/viewvc/llvm-project?rev=72930&view=rev
Log:
Add driver support for -fsigned-char/-funsigned-char.
Modified:
cfe/trunk/include/clang/Driver/Options.def
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=72930&r1=72929&r2=72930&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Fri Jun 5 02:21:14 2009
@@ -227,6 +227,7 @@
OPTION("--resource", _resource, Separate, INVALID, fcompile_resource_EQ, "J", 0, 0, 0)
OPTION("--save-temps", _save_temps, Flag, INVALID, save_temps, "", 0, 0, 0)
OPTION("--shared", _shared, Flag, INVALID, shared, "", 0, 0, 0)
+OPTION("--signed-char", _signed_char, Flag, INVALID, fsigned_char, "", 0, 0, 0)
OPTION("--specs=", _specs_EQ, Joined, INVALID, specs_EQ, "u", 0, 0, 0)
OPTION("--specs", _specs, Separate, INVALID, specs_EQ, "uJ", 0, 0, 0)
OPTION("--static", _static, Flag, INVALID, static, "", 0, 0, 0)
@@ -241,6 +242,7 @@
OPTION("--trigraphs", _trigraphs, Flag, INVALID, trigraphs, "", 0, 0, 0)
OPTION("--undefine-macro=", _undefine_macro_EQ, Joined, INVALID, U, "", 0, 0, 0)
OPTION("--undefine-macro", _undefine_macro, Separate, INVALID, U, "J", 0, 0, 0)
+OPTION("--unsigned-char", _unsigned_char, Flag, INVALID, funsigned_char, "", 0, 0, 0)
OPTION("--user-dependencies", _user_dependencies, Flag, INVALID, MM, "", 0, 0, 0)
OPTION("--verbose", _verbose, Flag, INVALID, v, "", 0, 0, 0)
OPTION("--version", _version, Flag, INVALID, INVALID, "", 0, 0, 0)
@@ -445,6 +447,7 @@
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("-fsigned-char", fsigned_char, 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)
@@ -455,6 +458,7 @@
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("-funsigned-char", funsigned_char, 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)
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=72930&r1=72929&r2=72930&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jun 5 02:21:14 2009
@@ -505,6 +505,16 @@
CmdArgs.push_back("-fblocks=0");
}
+ // -fsigned-char/-funsigned-char default varies depending on platform; only
+ // pass if specified.
+ if (Arg *A = Args.getLastArg(options::OPT_fsigned_char,
+ options::OPT_funsigned_char)) {
+ if (A->getOption().matches(options::OPT_fsigned_char))
+ CmdArgs.push_back("-fsigned-char");
+ else
+ CmdArgs.push_back("-fsigned-char=0");
+ }
+
// -fno-pascal-strings is default, only pass non-default. If the
// -tool chain happened to translate to -mpascal-strings, we want to
// -back translate here.
More information about the cfe-commits
mailing list