]> granicus.if.org Git - clang/commitdiff
Driver: Add OptTable::getOptionKind.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 31 Mar 2009 21:26:12 +0000 (21:26 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 31 Mar 2009 21:26:12 +0000 (21:26 +0000)
Also, removed default value for getOptionMetaVar.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68146 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.h
lib/Driver/OptTable.cpp

index 83d98dde2ccde51f4c10bfbd3be5bece53f5b24e..8b959d369c0e127a8aef6f482e9c02f3b34bdd0f 100644 (file)
@@ -61,6 +61,9 @@ namespace options {
     /// creating it if necessary.
     const Option *getOption(options::ID id) const;
 
+    /// getOptionKind - Get the kind of the given option.
+    unsigned getOptionKind(options::ID id) const;
+
     /// getOptionHelpText - Get the help text to use to describe this
     /// option.
     const char *getOptionHelpText(options::ID id) const;
index 4c198fc24f75d90ca4cd0d5cd07fa9762f4f0341..15b121c45b1bc0ec361dc78b580e3621bbaeff44 100644 (file)
@@ -137,14 +137,16 @@ const char *OptTable::getOptionName(options::ID id) const {
   return getInfo(id).Name;
 }
 
+unsigned OptTable::getOptionKind(options::ID id) const {
+  return getInfo(id).Kind;
+}
+
 const char *OptTable::getOptionHelpText(options::ID id) const {
   return getInfo(id).HelpText;
 }
 
 const char *OptTable::getOptionMetaVar(options::ID id) const {
-  const char *Name = getInfo(id).MetaVar;
-  // FIXME: This will need translation.
-  return Name ? Name : "<var>";
+  return getInfo(id).MetaVar;
 }
 
 const Option *OptTable::getOption(options::ID id) const {