[cfe-commits] r144001 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp
Chad Rosier
mcrosier at apple.com
Mon Nov 7 11:51:54 PST 2011
Author: mcrosier
Date: Mon Nov 7 13:51:54 2011
New Revision: 144001
URL: http://llvm.org/viewvc/llvm-project?rev=144001&view=rev
Log:
Tablegenify -g options.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=144001&r1=144000&r2=144001&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Nov 7 13:51:54 2011
@@ -512,13 +512,16 @@
def ffunction_sections: Flag <"-ffunction-sections">, Group<f_Group>;
def fdata_sections : Flag <"-fdata-sections">, Group<f_Group>;
def f : Joined<"-f">, Group<f_Group>;
-def g0 : Joined<"-g0">, Group<g_Group>;
-def g3 : Joined<"-g3">, Group<g_Group>;
-def gfull : Joined<"-gfull">, Group<g_Group>;
-def gstabs : Joined<"-gstabs">, Group<g_Group>;
-def gused : Joined<"-gused">, Group<g_Group>;
+def g0 : Flag<"-g0">, Group<g_Group>;
+def g3 : Flag<"-g3">, Group<g_Group>;
+def gdwarf2 : Flag<"-gdwarf-2">, Group<g_Group>;
+def gfull : Flag<"-gfull">, Group<g_Group>;
+def gstabs : Flag<"-gstabs">, Group<g_Group>;
+def gstabsplus : Flag<"-gstabs+">, Group<g_Group>;
+def gstabs1 : Flag<"-gstabs1">, Group<g_Group>;
+def gstabs2 : Flag<"-gstabs2">, Group<g_Group>;
+def gused : Flag<"-gused">, Group<g_Group>;
def g_Flag : Flag<"-g">, Group<g_Group>;
-def g_Joined : Joined<"-g">, Group<g_Group>;
def headerpad__max__install__names : Joined<"-headerpad_max_install_names">;
def index_header_map : Flag<"-index-header-map">;
def idirafter : JoinedOrSeparate<"-idirafter">, Group<clang_i_Group>;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=144001&r1=144000&r2=144001&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Nov 7 13:51:54 2011
@@ -1458,22 +1458,7 @@
Args.ClaimAllArgs(options::OPT_g_Group);
if (Arg *A = Args.getLastArg(options::OPT_g_Group))
if (!A->getOption().matches(options::OPT_g0)) {
- const std::string &ArgString = A->getAsString(Args);
- bool Valid_g = llvm::StringSwitch<bool>(ArgString)
- .Case("-g", true)
- .Case("-g3", true)
- .Case("-gdwarf-2", true)
- .Case("-gstabs", true)
- .Case("-gstabs+", true)
- .Case("-gstabs1", true)
- .Case("-gstabs2", true)
- .Case("-gfull", true)
- .Case("-gused", true)
- .Default(false);
- if (Valid_g)
CmdArgs.push_back("-g");
- else
- D.Diag(diag::warn_drv_clang_unsupported) << ArgString;
}
Args.AddAllArgs(CmdArgs, options::OPT_ffunction_sections);
More information about the cfe-commits
mailing list