[cfe-commits] r89371 - in /cfe/trunk: include/clang/Driver/CC1Options.h include/clang/Driver/OptParser.td include/clang/Driver/Options.h lib/Driver/CC1Options.cpp lib/Driver/DriverOptions.cpp

Daniel Dunbar daniel at zuster.org
Thu Nov 19 10:47:18 PST 2009


Author: ddunbar
Date: Thu Nov 19 12:47:17 2009
New Revision: 89371

URL: http://llvm.org/viewvc/llvm-project?rev=89371&view=rev
Log:
Driver: Move INPUT and UNKNOWN sentinel options into the OptParser.td file.

Modified:
    cfe/trunk/include/clang/Driver/CC1Options.h
    cfe/trunk/include/clang/Driver/OptParser.td
    cfe/trunk/include/clang/Driver/Options.h
    cfe/trunk/lib/Driver/CC1Options.cpp
    cfe/trunk/lib/Driver/DriverOptions.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.h?rev=89371&r1=89370&r2=89371&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.h (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.h Thu Nov 19 12:47:17 2009
@@ -17,8 +17,6 @@
 namespace cc1options {
   enum ID {
     OPT_INVALID = 0, // This is not an option ID.
-    OPT_INPUT,       // Reserved ID for input option.
-    OPT_UNKNOWN,     // Reserved ID for unknown option.
 #define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
                HELPTEXT, METAVAR) OPT_##ID,
 #include "clang/Driver/CC1Options.inc"

Modified: cfe/trunk/include/clang/Driver/OptParser.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/OptParser.td?rev=89371&r1=89370&r2=89371&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/OptParser.td (original)
+++ cfe/trunk/include/clang/Driver/OptParser.td Thu Nov 19 12:47:17 2009
@@ -24,6 +24,10 @@
 
 // An option group.
 def KIND_GROUP : OptionKind<"Group">;
+// The input option kind.
+def KIND_INPUT : OptionKind<"Input", 1, 1>;
+// The unknown option kind.
+def KIND_UNKNOWN : OptionKind<"Unknown", 2, 1>;
 // A flag with no values.
 def KIND_FLAG : OptionKind<"Flag">;
 // An option which prefixes its (single) value.
@@ -116,3 +120,10 @@
 class Group<OptionGroup group> { OptionGroup Group = group; }
 class HelpText<string text> { string HelpText = text; }
 class MetaVarName<string name> { string MetaVarName = name; }
+
+// Predefined options.
+
+// FIXME: Have generator validate that these appear in correct position (and
+// aren't duplicated).
+def INPUT : Option<"<input>", KIND_INPUT>, Flags<[DriverOption]>;
+def UNKNOWN : Option<"<unknown>", KIND_UNKNOWN>;

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

==============================================================================
--- cfe/trunk/include/clang/Driver/Options.h (original)
+++ cfe/trunk/include/clang/Driver/Options.h Thu Nov 19 12:47:17 2009
@@ -17,8 +17,6 @@
 namespace options {
   enum ID {
     OPT_INVALID = 0, // This is not an option ID.
-    OPT_INPUT,       // Reserved ID for input option.
-    OPT_UNKNOWN,     // Reserved ID for unknown option.
 #define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
                HELPTEXT, METAVAR) OPT_##ID,
 #include "clang/Driver/Options.inc"

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

==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Thu Nov 19 12:47:17 2009
@@ -16,11 +16,6 @@
 using namespace clang::driver::cc1options;
 
 static OptTable::Info CC1InfoTable[] = {
-  // The InputOption info
-  { "<input>", 0, 0, Option::InputClass, DriverOption, 0, OPT_INVALID, OPT_INVALID },
-  // The UnknownOption info
-  { "<unknown>", 0, 0, Option::UnknownClass, 0, 0, OPT_INVALID, OPT_INVALID },
-
 #define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
                HELPTEXT, METAVAR)   \
   { NAME, HELPTEXT, METAVAR, Option::KIND##Class, FLAGS, PARAM, \

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

==============================================================================
--- cfe/trunk/lib/Driver/DriverOptions.cpp (original)
+++ cfe/trunk/lib/Driver/DriverOptions.cpp Thu Nov 19 12:47:17 2009
@@ -15,11 +15,6 @@
 using namespace clang::driver::options;
 
 static OptTable::Info InfoTable[] = {
-  // The InputOption info
-  { "<input>", 0, 0, Option::InputClass, DriverOption, 0, OPT_INVALID, OPT_INVALID },
-  // The UnknownOption info
-  { "<unknown>", 0, 0, Option::UnknownClass, 0, 0, OPT_INVALID, OPT_INVALID },
-
 #define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
                HELPTEXT, METAVAR)   \
   { NAME, HELPTEXT, METAVAR, Option::KIND##Class, FLAGS, PARAM, \





More information about the cfe-commits mailing list