[cfe-commits] r66759 - in /cfe/trunk: include/clang/Driver/Options.def include/clang/Driver/Options.h lib/Driver/OptTable.cpp

Daniel Dunbar daniel at zuster.org
Wed Mar 11 18:46:53 PDT 2009


Author: ddunbar
Date: Wed Mar 11 20:46:53 2009
New Revision: 66759

URL: http://llvm.org/viewvc/llvm-project?rev=66759&view=rev
Log:
Driver: Reorder arguments in Options.def so option name is first.

Modified:
    cfe/trunk/include/clang/Driver/Options.def
    cfe/trunk/include/clang/Driver/Options.h
    cfe/trunk/lib/Driver/OptTable.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Wed Mar 11 20:46:53 2009
@@ -16,17 +16,17 @@
 #error "Define OPTION prior to including this file!"
 #endif
 
-// OPTION(ID, KIND, NAME, GROUP, ALIAS, FLAGS, PARAM)
+// OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM)
 
-// The first value provided to the macro specifies the internal name
-// of the option, and results in a clang::driver::options::XX enum
+// The first value is the option name as a string.
+
+// The second value is the internal option id, which must be a valid
+// C++ identifier, and results in a clang::driver::options::XX enum
 // value for XX.
 
-// The second value is the option type, one of Group, Flag, Joined,
+// The third value is the option type, one of Group, Flag, Joined,
 // Separate, CommaJoined, JoinedOrSeparate, JoinedAndSeparate.
 
-// The third value is the option name.
-
 // The fourth value is the internal name of the option group, or 0 if
 // the option is not part of a group.
 
@@ -52,7 +52,7 @@
 /// this is only used for specifying the number of arguments for
 /// Separate options.
 
-OPTION(ArchOpt, Separate, "-arch", 0, 0, "", 0)
-OPTION(PassExitCodesFlag, Flag, "-pass-exit-codes", 0, 0, "", 0)
-OPTION(PrintFileNameOpt, Joined, "-print-file-name=", 0, 0, "", 0)
-OPTION(WpOpt, CommaJoined, "-Wp,", 0, 0, "", 0)
+OPTION("-arch", ArchOpt, Separate, 0, 0, "", 0)
+OPTION("-pass-exit-codes", PassExitCodesFlag, Flag, 0, 0, "", 0)
+OPTION("-print-file-name=", PrintFileNameOpt, Joined, 0, 0, "", 0)
+OPTION("-Wp,", WpOpt, CommaJoined, 0, 0, "", 0)

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

==============================================================================
--- cfe/trunk/include/clang/Driver/Options.h (original)
+++ cfe/trunk/include/clang/Driver/Options.h Wed Mar 11 20:46:53 2009
@@ -17,7 +17,7 @@
     NotOption = 0, // This is not an option ID.
     InputOpt,      // Reserved ID for input option.
     UnknownOpt,    // Reserved ID for unknown option.
-#define OPTION(ID, KIND, NAME, GROUP, ALIAS, FLAGS, PARAM) ID,
+#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM) ID,
 #include "clang/Driver/Options.def"
     LastOption
 #undef OPTION

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

==============================================================================
--- cfe/trunk/lib/Driver/OptTable.cpp (original)
+++ cfe/trunk/lib/Driver/OptTable.cpp Wed Mar 11 20:46:53 2009
@@ -19,22 +19,23 @@
 using namespace clang::driver::options;
 
 struct Info {
-  Option::OptionClass Kind;
   const char *Name;
+  const char *Flags;
+
+  Option::OptionClass Kind;
   unsigned GroupID;
   unsigned AliasID;
-  const char *Flags;
   unsigned Param;
 };
 
 static Info OptionInfos[] = {
   // The InputOption info
-  { Option::InputClass, "<input>", 0, 0, "", 0 },
+  { "<input>", "", Option::InputClass, 0, 0, 0 },
   // The UnknownOption info
-  { Option::UnknownClass, "<unknown>", 0, 0, "", 0 },
+  { "<unknown>", "", Option::UnknownClass, 0, 0, 0 },
   
-#define OPTION(ID, KIND, NAME, GROUP, ALIAS, FLAGS, PARAM)      \
-  { Option::KIND##Class, NAME, GROUP, ALIAS, FLAGS, PARAM },
+#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM) \
+  { NAME, FLAGS, Option::KIND##Class, GROUP, ALIAS, PARAM },
 #include "clang/Driver/Options.def"
 };
 static const unsigned numOptions = sizeof(OptionInfos) / sizeof(OptionInfos[0]);





More information about the cfe-commits mailing list