diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -296,61 +296,75 @@ } //===----------------------------------------------------------------------===// -// BoolOptionBase +// BoolOption //===----------------------------------------------------------------------===// -// Default value of the keypath associated with a marshalled bool option. +// The default value of a marshalled key path. class Default { code Value = value; } -class FlagPolarity { bit Value = value; } -def PosFlag : FlagPolarity {} -def NegFlag : FlagPolarity {} +// Convenience variables for boolean defaults. +def DefaultTrue : Default<"true"> {} +def DefaultFalse : Default<"false"> {} + +// The value set to the key path when the flag is present on the command line. +class Set { bit Value = value; } +def SetTrue : Set {} +def SetFalse : Set {} -// Definition of a single command line flag. -class FlagDef option_flags, +// Definition of single command line flag. This is an implementation detail, use +// SetTrueBy or SetFalseBy instead. +class FlagDef option_flags, string help, list