diff options
Diffstat (limited to 'include/clang/Driver/OptParser.td')
-rw-r--r-- | include/clang/Driver/OptParser.td | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/Driver/OptParser.td b/include/clang/Driver/OptParser.td index 70b59c6..f5b6980 100644 --- a/include/clang/Driver/OptParser.td +++ b/include/clang/Driver/OptParser.td @@ -14,14 +14,20 @@ // Define the kinds of options. -class OptionKind<string name, int predecence = 0> { +class OptionKind<string name, int predecence = 0, bit sentinel = 0> { string Name = name; // The kind precedence, kinds with lower precedence are matched first. int Precedence = predecence; + // Indicate a sentinel option. + bit Sentinel = sentinel; } // 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. @@ -114,3 +120,10 @@ class Flags<list<OptionFlag> flags> { list<OptionFlag> Flags = flags; } 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>; |