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 @@ -435,12 +435,17 @@ // Key paths that are constant during parsing of options with the same key path prefix. defvar cplusplus = LangOpts<"CPlusPlus">; +defvar cpp11 = LangOpts<"CPlusPlus11">; +defvar cpp20 = LangOpts<"CPlusPlus20">; defvar c99 = LangOpts<"C99">; +defvar c2x = LangOpts<"C2x">; defvar lang_std = LangOpts<"LangStd">; defvar open_cl = LangOpts<"OpenCL">; defvar render_script = LangOpts<"RenderScript">; defvar hip = LangOpts<"HIP">; defvar gnu_mode = LangOpts<"GNUMode">; +defvar asm_preprocessor = LangOpts<"AsmPreprocessor">; +defvar cpp_modules = LangOpts<"CPlusPlusModules">; defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")"); @@ -997,20 +1002,16 @@ def : Flag<["-"], "shared-libasan">, Alias; def fasm : Flag<["-"], "fasm">, Group; -defm asm_blocks : OptInFFlag<"asm-blocks", "">; - def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group; def fastcp : Flag<["-"], "fastcp">, Group; def fastf : Flag<["-"], "fastf">, Group; def fast : Flag<["-"], "fast">, Group; def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group; -def fdouble_square_bracket_attributes : Flag<[ "-" ], "fdouble-square-bracket-attributes">, - Group, Flags<[NoXarchOption, CC1Option]>, - HelpText<"Enable '[[]]' attributes in all C and C++ language modes">; -def fno_double_square_bracket_attributes : Flag<[ "-" ], "fno-double-square-bracket-attributes">, - Group, Flags<[NoXarchOption, CC1Option]>, - HelpText<"Disable '[[]]' attributes in all C and C++ language modes">; +defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attributes", + LangOpts<"DoubleSquareBracketAttributes">, Default, + PosFlag, NegFlag, + BothFlags<[NoXarchOption, CC1Option], " '[[]]' attributes in all C and C++ language modes">>; defm autolink : BoolFOption<"autolink", CodeGenOpts<"Autolink">, DefaultTrue, @@ -1018,7 +1019,10 @@ PosFlag>; // C++ Coroutines TS -defm coroutines_ts : OptInFFlag<"coroutines-ts", "Enable support for the C++ Coroutines TS">; +defm coroutines_ts : BoolFOption<"coroutines-ts", + LangOpts<"Coroutines">, Default, + PosFlag, + NegFlag>; def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">, Group, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"