Skip to content

Commit b6d87e6

Browse files
committed
[clang][cli] Port LangOpts to marshalling system, pt.1
Port some miscellaneous language options to the marshalling system for oautomatic command line parsing and generation. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D95346
1 parent 7c15e0f commit b6d87e6

File tree

2 files changed

+61
-85
lines changed

2 files changed

+61
-85
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 59 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,17 @@ class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default>
435435

436436
// Key paths that are constant during parsing of options with the same key path prefix.
437437
defvar cplusplus = LangOpts<"CPlusPlus">;
438+
defvar cpp11 = LangOpts<"CPlusPlus11">;
439+
defvar cpp20 = LangOpts<"CPlusPlus20">;
438440
defvar c99 = LangOpts<"C99">;
441+
defvar c2x = LangOpts<"C2x">;
439442
defvar lang_std = LangOpts<"LangStd">;
440443
defvar open_cl = LangOpts<"OpenCL">;
441444
defvar render_script = LangOpts<"RenderScript">;
442445
defvar hip = LangOpts<"HIP">;
443446
defvar gnu_mode = LangOpts<"GNUMode">;
447+
defvar asm_preprocessor = LangOpts<"AsmPreprocessor">;
448+
defvar cpp_modules = LangOpts<"CPlusPlusModules">;
444449

445450
defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
446451

@@ -997,28 +1002,27 @@ def static_libsan : Flag<["-"], "static-libsan">,
9971002
def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
9981003
def fasm : Flag<["-"], "fasm">, Group<f_Group>;
9991004

1000-
defm asm_blocks : OptInFFlag<"asm-blocks", "">;
1001-
10021005
def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;
10031006
def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;
10041007
def fastf : Flag<["-"], "fastf">, Group<f_Group>;
10051008
def fast : Flag<["-"], "fast">, Group<f_Group>;
10061009
def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group<f_Group>;
10071010

1008-
def fdouble_square_bracket_attributes : Flag<[ "-" ], "fdouble-square-bracket-attributes">,
1009-
Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1010-
HelpText<"Enable '[[]]' attributes in all C and C++ language modes">;
1011-
def fno_double_square_bracket_attributes : Flag<[ "-" ], "fno-double-square-bracket-attributes">,
1012-
Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1013-
HelpText<"Disable '[[]]' attributes in all C and C++ language modes">;
1011+
defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attributes",
1012+
LangOpts<"DoubleSquareBracketAttributes">, Default<!strconcat(cpp11.KeyPath, "||", c2x.KeyPath)>,
1013+
PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
1014+
BothFlags<[NoXarchOption, CC1Option], " '[[]]' attributes in all C and C++ language modes">>;
10141015

10151016
defm autolink : BoolFOption<"autolink",
10161017
CodeGenOpts<"Autolink">, DefaultTrue,
10171018
NegFlag<SetFalse, [CC1Option], "Disable generation of linker directives for automatic library linking">,
10181019
PosFlag<SetTrue>>;
10191020

10201021
// C++ Coroutines TS
1021-
defm coroutines_ts : OptInFFlag<"coroutines-ts", "Enable support for the C++ Coroutines TS">;
1022+
defm coroutines_ts : BoolFOption<"coroutines-ts",
1023+
LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
1024+
PosFlag<SetTrue, [CC1Option], "Enable support for the C++ Coroutines TS">,
1025+
NegFlag<SetFalse>>;
10221026

10231027
def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
10241028
Group<f_Group>, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
@@ -1273,8 +1277,10 @@ def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group<f_clang_Gr
12731277
HelpText<"Discard value names in LLVM IR">, Flags<[NoXarchOption]>;
12741278
def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">, Group<f_clang_Group>,
12751279
HelpText<"Do not discard value names in LLVM IR">, Flags<[NoXarchOption]>;
1276-
def fdollars_in_identifiers : Flag<["-"], "fdollars-in-identifiers">, Group<f_Group>,
1277-
HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>;
1280+
defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
1281+
LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,
1282+
PosFlag<SetTrue, [], "Allow">, NegFlag<SetFalse, [], "Disallow">,
1283+
BothFlags<[CC1Option], " '$' in identifiers">>;
12781284
def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
12791285
def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
12801286
defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
@@ -1358,7 +1364,10 @@ defm keep_static_consts : BoolFOption<"keep-static-consts",
13581364
CodeGenOpts<"KeepStaticConsts">, DefaultFalse,
13591365
PosFlag<SetTrue, [CC1Option], "Keep">, NegFlag<SetFalse, [], "Don't keep">,
13601366
BothFlags<[NoXarchOption], " static const variables if unused">>;
1361-
defm fixed_point : OptInFFlag<"fixed-point", "Enable", "Disable", " fixed point types">;
1367+
defm fixed_point : BoolFOption<"fixed-point",
1368+
LangOpts<"FixedPoint">, DefaultFalse,
1369+
PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1370+
BothFlags<[], " fixed point types">>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
13621371
defm cxx_static_destructors : BoolFOption<"c++-static-destructors",
13631372
LangOpts<"RegisterStaticDestructors">, DefaultTrue,
13641373
NegFlag<SetFalse, [CC1Option], "Disable C++ static destructor registration">,
@@ -1810,11 +1819,15 @@ defm merge_all_constants : BoolFOption<"merge-all-constants",
18101819
def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>, Flags<[CC1Option]>,
18111820
HelpText<"Format message diagnostics so that they fit within N columns">,
18121821
MarshallingInfoStringInt<DiagnosticOpts<"MessageLength">>;
1813-
def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1814-
HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">;
18151822
def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
18161823
HelpText<"Enable full Microsoft Visual C++ compatibility">,
18171824
MarshallingInfoFlag<LangOpts<"MSVCCompat">>;
1825+
def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1826+
HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">,
1827+
MarshallingInfoFlag<LangOpts<"MicrosoftExt">>, ImpliedByAnyOf<[fms_compatibility.KeyPath]>;
1828+
defm asm_blocks : BoolFOption<"asm-blocks",
1829+
LangOpts<"AsmBlocks">, Default<fms_extensions.KeyPath>,
1830+
PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
18181831
def fms_volatile : Flag<["-"], "fms-volatile">, Group<f_Group>, Flags<[CC1Option]>,
18191832
MarshallingInfoFlag<CodeGenOpts<"MSVolatile">>;
18201833
def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
@@ -1858,9 +1871,6 @@ def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group
18581871
Flags<[CC1Option]>, MetaVarName<"<seconds>">,
18591872
HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">,
18601873
MarshallingInfoStringInt<HeaderSearchOpts<"ModuleCachePruneAfter">, "31 * 24 * 60 * 60">;
1861-
def fmodules_search_all : Flag <["-"], "fmodules-search-all">, Group<f_Group>,
1862-
Flags<[NoXarchOption, CC1Option]>,
1863-
HelpText<"Search even non-imported modules to resolve references">;
18641874
def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
18651875
Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">,
18661876
HelpText<"Time when the current build session started">,
@@ -1912,16 +1922,17 @@ defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ",
19121922
defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate ",
19131923
"debug info for types in an object file built from this PCH and do not generate them elsewhere">;
19141924

1915-
def fmodules : Flag <["-"], "fmodules">, Group<f_Group>,
1916-
Flags<[NoXarchOption, CC1Option]>,
1917-
HelpText<"Enable the 'modules' language feature">;
19181925
def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
19191926
Flags<[NoXarchOption, CC1Option]>,
19201927
HelpText<"Implicitly search the file system for module map files.">,
19211928
MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
19221929
def fmodules_ts : Flag <["-"], "fmodules-ts">, Group<f_Group>,
19231930
Flags<[CC1Option]>, HelpText<"Enable support for the C++ Modules TS">,
19241931
MarshallingInfoFlag<LangOpts<"ModulesTS">>;
1932+
defm modules : BoolFOption<"modules",
1933+
LangOpts<"Modules">, Default<!strconcat(fmodules_ts.KeyPath, "||", cpp_modules.KeyPath)>,
1934+
PosFlag<SetTrue, [CC1Option], "Enable the 'modules' language feature">,
1935+
NegFlag<SetFalse>, BothFlags<[NoXarchOption]>>;
19251936
def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias<fimplicit_module_maps>;
19261937
def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
19271938
Flags<[NoXarchOption,CC1Option]>, MetaVarName<"<name>">,
@@ -1942,15 +1953,19 @@ def fmodule_file : Joined<["-"], "fmodule-file=">,
19421953
HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">;
19431954
def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>, Flags<[CC1Option]>,
19441955
HelpText<"Ignore the definition of the given macro when building and loading modules">;
1945-
def fmodules_decluse : Flag <["-"], "fmodules-decluse">, Group<f_Group>,
1946-
Flags<[NoXarchOption,CC1Option]>,
1947-
HelpText<"Require declaration of modules used within a module">;
19481956
def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group<f_Group>,
19491957
Flags<[NoXarchOption,CC1Option]>,
19501958
HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
19511959
MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
1952-
def fno_modules_search_all : Flag <["-"], "fno-modules-search-all">, Group<f_Group>,
1953-
Flags<[NoXarchOption, CC1Option]>;
1960+
defm modules_decluse : BoolFOption<"modules-decluse",
1961+
LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
1962+
PosFlag<SetTrue, [CC1Option], "Require declaration of modules used within a module">,
1963+
NegFlag<SetFalse>, BothFlags<[NoXarchOption]>>;
1964+
defm modules_search_all : BoolFOption<"modules-search-all",
1965+
LangOpts<"ModulesSearchAll">, DefaultFalse,
1966+
PosFlag<SetTrue, [], "Search even non-imported modules to resolve references">,
1967+
NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option]>>,
1968+
ShouldParseIf<fmodules.KeyPath>;
19541969
defm implicit_modules : BoolFOption<"implicit-modules",
19551970
LangOpts<"ImplicitModules">, DefaultTrue,
19561971
NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[NoXarchOption]>>;
@@ -1984,8 +1999,6 @@ defm digraphs : BoolFOption<"digraphs",
19841999
BothFlags<[CC1Option]>>;
19852000
def fno_declspec : Flag<["-"], "fno-declspec">, Group<f_clang_Group>,
19862001
HelpText<"Disallow __declspec as a keyword">, Flags<[CC1Option]>;
1987-
def fno_dollars_in_identifiers : Flag<["-"], "fno-dollars-in-identifiers">, Group<f_Group>,
1988-
HelpText<"Disallow '$' in identifiers">, Flags<[CC1Option]>;
19892002
def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group<f_Group>;
19902003
def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>;
19912004
def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Option]>;
@@ -2001,13 +2014,9 @@ def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
20012014
MarshallingInfoString<CodeGenOpts<"VecLib">, "NoLibrary">, AutoNormalizeEnum;
20022015
def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
20032016
Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;
2004-
def fno_modules : Flag <["-"], "fno-modules">, Group<f_Group>,
2005-
Flags<[NoXarchOption]>;
20062017
def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>,
20072018
Flags<[NoXarchOption]>;
20082019
def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
2009-
def fno_modules_decluse : Flag <["-"], "fno-modules-decluse">, Group<f_Group>,
2010-
Flags<[NoXarchOption]>;
20112020
def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>,
20122021
Flags<[NoXarchOption]>;
20132022
def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>,
@@ -2023,7 +2032,7 @@ def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>, Flags<[CC1Opti
20232032
def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>;
20242033
def fno_operator_names : Flag<["-"], "fno-operator-names">, Group<f_Group>,
20252034
HelpText<"Do not treat C++ operator name keywords as synonyms for operators">,
2026-
Flags<[CC1Option]>;
2035+
Flags<[CC1Option]>, MarshallingInfoNegativeFlag<LangOpts<"CXXOperatorNames">, cplusplus.KeyPath>;
20272036
def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
20282037
Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">,
20292038
MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
@@ -2220,8 +2229,14 @@ def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
22202229
def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
22212230
def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
22222231
HelpText<"Override the default ABI to return small structs in registers">;
2223-
defm rtti : OptOutFFlag<"rtti", "", "Disable generation of rtti information">;
2224-
defm rtti_data : OptOutFFlag<"rtti-data", "", "Disable generation of RTTI data">;
2232+
defm rtti : BoolFOption<"rtti",
2233+
LangOpts<"RTTI">, Default<cplusplus.KeyPath>,
2234+
NegFlag<SetFalse, [CC1Option], "Disable generation of rtti information">,
2235+
PosFlag<SetTrue>>, ShouldParseIf<cplusplus.KeyPath>;
2236+
defm rtti_data : BoolFOption<"rtti-data",
2237+
LangOpts<"RTTIData">, Default<frtti.KeyPath>,
2238+
NegFlag<SetFalse, [CC1Option], "Disable generation of RTTI data">,
2239+
PosFlag<SetTrue>>, ShouldParseIf<frtti.KeyPath>;
22252240
def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
22262241
defm short_enums : BoolFOption<"short-enums",
22272242
LangOpts<"ShortEnums">, DefaultFalse,
@@ -4201,9 +4216,11 @@ def mfpmath : Separate<["-"], "mfpmath">,
42014216
HelpText<"Which unit to use for fp math">,
42024217
MarshallingInfoString<TargetOpts<"FPMath">>;
42034218

4204-
def fpadding_on_unsigned_fixed_point : Flag<["-"], "fpadding-on-unsigned-fixed-point">,
4205-
HelpText<"Force each unsigned fixed point type to have an extra bit of padding to align their scales with those of signed fixed point types">;
4206-
def fno_padding_on_unsigned_fixed_point : Flag<["-"], "fno-padding-on-unsigned-fixed-point">;
4219+
defm padding_on_unsigned_fixed_point : BoolOption<"f", "padding-on-unsigned-fixed-point",
4220+
LangOpts<"PaddingOnUnsignedFixedPoint">, DefaultFalse,
4221+
PosFlag<SetTrue, [], "Force each unsigned fixed point type to have an extra bit of padding to align their scales with those of signed fixed point types">,
4222+
NegFlag<SetFalse>>,
4223+
ShouldParseIf<ffixed_point.KeyPath>;
42074224

42084225
//===----------------------------------------------------------------------===//
42094226
// Analyzer Options
@@ -4845,10 +4862,14 @@ def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
48454862
HelpText<"Embed the contents of all files read by this compilation into "
48464863
"the produced module file.">,
48474864
MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>;
4865+
// FIXME: We only need this in C++ modules / Modules TS if we might textually
4866+
// enter a different module (eg, when building a header unit).
48484867
def fmodules_local_submodule_visibility :
48494868
Flag<["-"], "fmodules-local-submodule-visibility">,
48504869
HelpText<"Enforce name visibility rules across submodules of the same "
4851-
"top-level module.">;
4870+
"top-level module.">,
4871+
MarshallingInfoFlag<LangOpts<"ModulesLocalVisibility">>,
4872+
ImpliedByAnyOf<[fmodules_ts.KeyPath, cpp_modules.KeyPath]>;
48524873
def fmodules_codegen :
48534874
Flag<["-"], "fmodules-codegen">,
48544875
HelpText<"Generate code for uses of this module that assumes an explicit "

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
20172017
Opts.HexFloats = Std.hasHexFloats();
20182018
Opts.ImplicitInt = Std.hasImplicitInt();
20192019

2020+
Opts.CPlusPlusModules = Opts.CPlusPlus20;
2021+
20202022
// Set OpenCL Version.
20212023
Opts.OpenCL = Std.isOpenCL();
20222024
if (LangStd == LangStandard::lang_opencl10)
@@ -2078,14 +2080,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
20782080
// C++ has wchar_t keyword.
20792081
Opts.WChar = Opts.CPlusPlus;
20802082

2081-
Opts.CXXOperatorNames = Opts.CPlusPlus;
2082-
20832083
Opts.AlignedAllocation = Opts.CPlusPlus17;
2084-
2085-
Opts.DollarIdents = !Opts.AsmPreprocessor;
2086-
2087-
// Enable [[]] attributes in C++11 and C2x by default.
2088-
Opts.DoubleSquareBracketAttributes = Opts.CPlusPlus11 || Opts.C2x;
20892084
}
20902085

20912086
/// Check if input file kind and language standard are compatible.
@@ -2263,9 +2258,6 @@ void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
22632258
}
22642259
}
22652260

2266-
if (Args.hasArg(OPT_fno_operator_names))
2267-
Opts.CXXOperatorNames = 0;
2268-
22692261
if (Opts.ObjC) {
22702262
if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
22712263
StringRef value = arg->getValue();
@@ -2337,8 +2329,6 @@ void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
23372329
else if (Args.hasArg(OPT_fwrapv))
23382330
Opts.setSignedOverflowBehavior(LangOptions::SOB_Defined);
23392331

2340-
Opts.MicrosoftExt = Opts.MSVCCompat || Args.hasArg(OPT_fms_extensions);
2341-
Opts.AsmBlocks = Args.hasArg(OPT_fasm_blocks) || Opts.MicrosoftExt;
23422332
Opts.MSCompatibilityVersion = 0;
23432333
if (const Arg *A = Args.getLastArg(OPT_fms_compatibility_version)) {
23442334
VersionTuple VT;
@@ -2359,48 +2349,13 @@ void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
23592349
Opts.Trigraphs =
23602350
Args.hasFlag(OPT_ftrigraphs, OPT_fno_trigraphs, Opts.Trigraphs);
23612351

2362-
Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers,
2363-
OPT_fno_dollars_in_identifiers,
2364-
Opts.DollarIdents);
2365-
2366-
// -ffixed-point
2367-
Opts.FixedPoint =
2368-
Args.hasFlag(OPT_ffixed_point, OPT_fno_fixed_point, /*Default=*/false) &&
2369-
!Opts.CPlusPlus;
2370-
Opts.PaddingOnUnsignedFixedPoint =
2371-
Args.hasFlag(OPT_fpadding_on_unsigned_fixed_point,
2372-
OPT_fno_padding_on_unsigned_fixed_point,
2373-
/*Default=*/false) &&
2374-
Opts.FixedPoint;
2375-
2376-
Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
2377-
Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
23782352
Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL
23792353
&& Opts.OpenCLVersion == 200);
2380-
Opts.Coroutines = Opts.CPlusPlus20 || Args.hasArg(OPT_fcoroutines_ts);
23812354

23822355
Opts.ConvergentFunctions = Opts.OpenCL || (Opts.CUDA && Opts.CUDAIsDevice) ||
23832356
Opts.SYCLIsDevice ||
23842357
Args.hasArg(OPT_fconvergent_functions);
23852358

2386-
Opts.DoubleSquareBracketAttributes =
2387-
Args.hasFlag(OPT_fdouble_square_bracket_attributes,
2388-
OPT_fno_double_square_bracket_attributes,
2389-
Opts.DoubleSquareBracketAttributes);
2390-
2391-
Opts.CPlusPlusModules = Opts.CPlusPlus20;
2392-
Opts.Modules =
2393-
Args.hasArg(OPT_fmodules) || Opts.ModulesTS || Opts.CPlusPlusModules;
2394-
Opts.ModulesDeclUse =
2395-
Args.hasArg(OPT_fmodules_decluse) || Opts.ModulesStrictDeclUse;
2396-
// FIXME: We only need this in C++ modules / Modules TS if we might textually
2397-
// enter a different module (eg, when building a header unit).
2398-
Opts.ModulesLocalVisibility =
2399-
Args.hasArg(OPT_fmodules_local_submodule_visibility) || Opts.ModulesTS ||
2400-
Opts.CPlusPlusModules;
2401-
Opts.ModulesSearchAll = Opts.Modules &&
2402-
!Args.hasArg(OPT_fno_modules_search_all) &&
2403-
Args.hasArg(OPT_fmodules_search_all);
24042359
Opts.CharIsSigned = Opts.OpenCL || !Args.hasArg(OPT_fno_signed_char);
24052360
Opts.WChar = Opts.CPlusPlus && !Args.hasArg(OPT_fno_wchar);
24062361
Opts.Char8 = Args.hasFlag(OPT_fchar8__t, OPT_fno_char8__t, Opts.CPlusPlus20);

0 commit comments

Comments
 (0)