@@ -994,7 +994,8 @@ def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=
994
994
def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
995
995
def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
996
996
def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>, Flags<[CC1Option]>,
997
- HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">;
997
+ HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
998
+ MarshallingInfoStringInt<"LangOpts->MaxTokens">;
998
999
def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
999
1000
def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
1000
1001
def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
@@ -1212,7 +1213,10 @@ defm complete_member_pointers : BoolOption<"complete-member-pointers",
1212
1213
" would be significant under the Microsoft ABI">, "f">,
1213
1214
Group<f_clang_Group>;
1214
1215
def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group<f_Group>,
1215
- Flags<[CC1Option]>;
1216
+ Flags<[CC1Option]>, Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
1217
+ NormalizedValuesScope<"LangOptions::CoreFoundationABI">,
1218
+ NormalizedValues<["ObjectiveC", "ObjectiveC", "ObjectiveC", "Swift5_0", "Swift5_0", "Swift4_2", "Swift4_1"]>,
1219
+ MarshallingInfoString<"LangOpts->CFRuntime", "ObjectiveC">, AutoNormalizeEnum;
1216
1220
defm constant_cfstrings : BoolFOption<"constant-cfstrings",
1217
1221
"LangOpts->NoConstantCFStrings", DefaultsToFalse,
1218
1222
ChangedBy<NegFlag, [], "Disable creation of CodeFoundation-type constant strings">,
@@ -1420,7 +1424,8 @@ defm sanitize_memory_use_after_dtor : BoolOption<"sanitize-memory-use-after-dtor
1420
1424
Group<f_clang_Group>;
1421
1425
def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-padding=">,
1422
1426
Group<f_clang_Group>,
1423
- HelpText<"Level of field padding for AddressSanitizer">;
1427
+ HelpText<"Level of field padding for AddressSanitizer">,
1428
+ MarshallingInfoStringInt<"LangOpts->SanitizeAddressFieldPadding">;
1424
1429
defm sanitize_address_use_after_scope : BoolOption<"sanitize-address-use-after-scope",
1425
1430
"CodeGenOpts.SanitizeAddressUseAfterScope", DefaultsToFalse,
1426
1431
ChangedBy<PosFlag, [], "Enable">, ResetBy<NegFlag, [CoreOption, NoXarchOption], "Disable">,
@@ -1739,7 +1744,10 @@ defm experimental_relative_cxx_abi_vtables : BoolFOption<"experimental-relative-
1739
1744
1740
1745
def flat__namespace : Flag<["-"], "flat_namespace">;
1741
1746
def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group<f_Group>,
1742
- HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>;
1747
+ HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>,
1748
+ NormalizedValuesScope<"LangOptions::LaxVectorConversionKind">,
1749
+ NormalizedValues<["None", "Integer", "All"]>,
1750
+ MarshallingInfoString<"LangOpts->LaxVectorConversions", "All">, AutoNormalizeEnum;
1743
1751
def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Group>,
1744
1752
Alias<flax_vector_conversions_EQ>, AliasArgs<["integer"]>;
1745
1753
def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
@@ -1791,7 +1799,12 @@ defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
1791
1799
ChangedBy<PosFlag, [], "Parse templated function definitions at the end of the translation unit">,
1792
1800
ResetBy<NegFlag, [NoXarchOption], "Disable delayed template parsing">,
1793
1801
BothFlags<[CoreOption]>>;
1794
- def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>, Flags<[CC1Option]>;
1802
+ def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>, Flags<[CC1Option]>,
1803
+ Values<"single,multiple,virtual">, NormalizedValuesScope<"LangOptions">,
1804
+ NormalizedValues<["PPTMK_FullGeneralitySingleInheritance", "PPTMK_FullGeneralityMultipleInheritance",
1805
+ "PPTMK_FullGeneralityVirtualInheritance"]>,
1806
+ MarshallingInfoString<"LangOpts->MSPointerToMemberRepresentationMethod", "PPTMK_BestCase">,
1807
+ AutoNormalizeEnum;
1795
1808
def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
1796
1809
Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
1797
1810
HelpText<"Specify the module cache path">;
@@ -1880,7 +1893,8 @@ def fmodules_ts : Flag <["-"], "fmodules-ts">, Group<f_Group>,
1880
1893
def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias<fimplicit_module_maps>;
1881
1894
def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
1882
1895
Flags<[NoXarchOption,CC1Option]>, MetaVarName<"<name>">,
1883
- HelpText<"Specify the name of the module to build">;
1896
+ HelpText<"Specify the name of the module to build">,
1897
+ MarshallingInfoString<"LangOpts->ModuleName">;
1884
1898
def fmodule_name : Separate<["-"], "fmodule-name">, Alias<fmodule_name_EQ>;
1885
1899
def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
1886
1900
Flags<[CC1Option]>, Alias<fmodule_name_EQ>;
@@ -2035,7 +2049,8 @@ def fno_aligned_allocation: Flag<["-"], "fno-aligned-allocation">,
2035
2049
Group<f_Group>, Flags<[CC1Option]>;
2036
2050
def fnew_alignment_EQ : Joined<["-"], "fnew-alignment=">,
2037
2051
HelpText<"Specifies the largest alignment guaranteed by '::operator new(size_t)'">,
2038
- MetaVarName<"<align>">, Group<f_Group>, Flags<[CC1Option]>;
2052
+ MetaVarName<"<align>">, Group<f_Group>, Flags<[CC1Option]>,
2053
+ MarshallingInfoStringInt<"LangOpts->NewAlignOverride">;
2039
2054
def : Separate<["-"], "fnew-alignment">, Alias<fnew_alignment_EQ>;
2040
2055
def : Flag<["-"], "faligned-new">, Alias<faligned_allocation>;
2041
2056
def : Flag<["-"], "fno-aligned-new">, Alias<fno_aligned_allocation>;
@@ -2120,9 +2135,11 @@ def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group<f_Group>;
2120
2135
def fpack_struct : Flag<["-"], "fpack-struct">, Group<f_Group>;
2121
2136
def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group<f_Group>;
2122
2137
def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>, Flags<[CC1Option]>,
2123
- HelpText<"Specify the default maximum struct packing alignment">;
2138
+ HelpText<"Specify the default maximum struct packing alignment">,
2139
+ MarshallingInfoStringInt<"LangOpts->PackStruct">;
2124
2140
def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>, Flags<[CC1Option]>,
2125
- HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">;
2141
+ HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">,
2142
+ MarshallingInfoStringInt<"LangOpts->MaxTypeAlign">;
2126
2143
def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
2127
2144
defm pascal_strings : BoolFOption<"pascal-strings",
2128
2145
"LangOpts->PascalStrings", DefaultsToFalse,
@@ -2217,12 +2234,16 @@ def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
2217
2234
"address. The reference stack guard value is stored in a global variable.">;
2218
2235
def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_Group>,
2219
2236
Flags<[CC1Option, CoreOption]>, HelpText<"Initialize trivial automatic stack variables: uninitialized (default)"
2220
- " | pattern">, Values<"uninitialized,pattern">;
2237
+ " | pattern">, Values<"uninitialized,zero,pattern">,
2238
+ NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
2239
+ NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
2240
+ MarshallingInfoString<"LangOpts->TrivialAutoVarInit", "Uninitialized">, AutoNormalizeEnum;
2221
2241
def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
2222
2242
Flags<[CC1Option, CoreOption]>,
2223
2243
HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
2224
2244
def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
2225
- Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">;
2245
+ Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
2246
+ MarshallingInfoStringInt<"LangOpts->TrivialAutoVarInitStopAfter">;
2226
2247
def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
2227
2248
HelpText<"Emit full debug info for all types used by the program">;
2228
2249
def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
@@ -2287,7 +2308,8 @@ def : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>;
2287
2308
def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
2288
2309
HelpText<"Warn if a function definition returns or accepts an object larger "
2289
2310
"in bytes than a given value">, Flags<[HelpHidden]>;
2290
- def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>;
2311
+ def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>,
2312
+ MarshallingInfoStringInt<"LangOpts->NumLargeByValueCopy">;
2291
2313
2292
2314
// These "special" warning flags are effectively processed as f_Group flags by the driver:
2293
2315
// Just silence warnings about -Wlarger-than for now.
@@ -2661,7 +2683,8 @@ def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group<clang_ignored_m_Grou
2661
2683
def mlong_calls : Flag<["-"], "mlong-calls">, Group<m_Group>,
2662
2684
HelpText<"Generate branches with extended addressability, usually via indirect jumps.">;
2663
2685
def mdouble_EQ : Joined<["-"], "mdouble=">, Group<m_Group>, Values<"32,64">, Flags<[CC1Option]>,
2664
- HelpText<"Force double to be 32 bits or 64 bits">;
2686
+ HelpText<"Force double to be 32 bits or 64 bits">,
2687
+ MarshallingInfoStringInt<"LangOpts->DoubleSize", "0">;
2665
2688
def LongDouble_Group : OptionGroup<"<LongDouble group>">, Group<m_Group>,
2666
2689
DocName<"Long double flags">,
2667
2690
DocBrief<[{Selects the long double implementation}]>;
@@ -4878,7 +4901,8 @@ def fno_wchar : Flag<["-"], "fno-wchar">,
4878
4901
HelpText<"Disable C++ builtin type wchar_t">;
4879
4902
def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
4880
4903
MetaVarName<"<class name>">,
4881
- HelpText<"Specify the class to use for constant Objective-C string objects.">;
4904
+ HelpText<"Specify the class to use for constant Objective-C string objects.">,
4905
+ MarshallingInfoString<"LangOpts->ObjCConstantStringClass">;
4882
4906
def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
4883
4907
HelpText<"Objective-C++ Automatic Reference Counting standard library kind">, Values<"libc++,libstdc++,none">;
4884
4908
def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
@@ -4892,7 +4916,8 @@ def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signa
4892
4916
HelpText<"enable extended encoding of block type signature">,
4893
4917
MarshallingInfoFlag<"LangOpts->EncodeExtendedBlockSig">;
4894
4918
def function_alignment : Separate<["-"], "function-alignment">,
4895
- HelpText<"default alignment for functions">;
4919
+ HelpText<"default alignment for functions">,
4920
+ MarshallingInfoStringInt<"LangOpts->FunctionAlignment">;
4896
4921
def pic_level : Separate<["-"], "pic-level">,
4897
4922
HelpText<"Value for __PIC__">;
4898
4923
def pic_is_pie : Flag<["-"], "pic-is-pie">,
@@ -4916,26 +4941,38 @@ def static_define : Flag<["-"], "static-define">,
4916
4941
HelpText<"Should __STATIC__ be defined">,
4917
4942
MarshallingInfoFlag<"LangOpts->Static">;
4918
4943
def stack_protector : Separate<["-"], "stack-protector">,
4919
- HelpText<"Enable stack protectors">;
4944
+ HelpText<"Enable stack protectors">, Values<"0,1,2,3">,
4945
+ NormalizedValuesScope<"LangOptions">,
4946
+ NormalizedValues<["SSPOff", "SSPOn", "SSPStrong", "SSPReq"]>,
4947
+ MarshallingInfoString<"LangOpts->StackProtector", "SSPOff">, AutoNormalizeEnum;
4920
4948
def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
4921
4949
HelpText<"Lower bound for a buffer to be considered for stack protection">;
4950
+ // FIXME: diagnose if target does not support protected visibility
4951
+ // Good place for this is CompilerInvocation::fixupInvocation. Do the same for parseVisibility.
4922
4952
def fvisibility : Separate<["-"], "fvisibility">,
4923
- HelpText<"Default type and symbol visibility">;
4953
+ HelpText<"Default type and symbol visibility">, Values<"default,hidden,internal,protected">,
4954
+ NormalizedValues<["DefaultVisibility", "HiddenVisibility", "HiddenVisibility", "ProtectedVisibility"]>,
4955
+ MarshallingInfoString<"LangOpts->ValueVisibilityMode", "DefaultVisibility">, AutoNormalizeEnum;
4924
4956
def ftype_visibility : Separate<["-"], "ftype-visibility">,
4925
4957
HelpText<"Default type visibility">;
4926
4958
def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-to-externs">,
4927
4959
HelpText<"Apply global symbol visibility to external declarations without an explicit visibility">,
4928
4960
MarshallingInfoFlag<"LangOpts->SetVisibilityForExternDecls">;
4929
4961
def ftemplate_depth : Separate<["-"], "ftemplate-depth">,
4930
- HelpText<"Maximum depth of recursive template instantiation">;
4962
+ HelpText<"Maximum depth of recursive template instantiation">,
4963
+ MarshallingInfoStringInt<"LangOpts->InstantiationDepth", "1024">;
4931
4964
def foperator_arrow_depth : Separate<["-"], "foperator-arrow-depth">,
4932
- HelpText<"Maximum number of 'operator->'s to call for a member access">;
4965
+ HelpText<"Maximum number of 'operator->'s to call for a member access">,
4966
+ MarshallingInfoStringInt<"LangOpts->ArrowDepth", "256">;
4933
4967
def fconstexpr_depth : Separate<["-"], "fconstexpr-depth">,
4934
- HelpText<"Maximum depth of recursive constexpr function calls">;
4968
+ HelpText<"Maximum depth of recursive constexpr function calls">,
4969
+ MarshallingInfoStringInt<"LangOpts->ConstexprCallDepth", "512">;
4935
4970
def fconstexpr_steps : Separate<["-"], "fconstexpr-steps">,
4936
- HelpText<"Maximum number of steps in constexpr function evaluation">;
4971
+ HelpText<"Maximum number of steps in constexpr function evaluation">,
4972
+ MarshallingInfoStringInt<"LangOpts->ConstexprStepLimit", "1048576">;
4937
4973
def fbracket_depth : Separate<["-"], "fbracket-depth">,
4938
- HelpText<"Maximum nesting level for parentheses, brackets, and braces">;
4974
+ HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
4975
+ MarshallingInfoStringInt<"LangOpts->BracketDepth", "256">;
4939
4976
defm const_strings : BoolFOption<"const-strings",
4940
4977
"LangOpts->ConstStrings", DefaultsToFalse,
4941
4978
ChangedBy<PosFlag, [], "Use">, ResetBy<NegFlag, [], "Don't use">,
@@ -4947,7 +4984,10 @@ def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">,
4947
4984
HelpText<"Use a fake address space map; OpenCL testing purposes only">,
4948
4985
MarshallingInfoFlag<"LangOpts->FakeAddressSpaceMap">;
4949
4986
def faddress_space_map_mangling_EQ : Joined<["-"], "faddress-space-map-mangling=">, MetaVarName<"<yes|no|target>">,
4950
- HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">;
4987
+ HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">,
4988
+ Values<"target,no,yes">, NormalizedValuesScope<"LangOptions">,
4989
+ NormalizedValues<["ASMM_Target", "ASMM_Off", "ASMM_On"]>,
4990
+ MarshallingInfoString<"LangOpts->AddressSpaceMapMangling", "ASMM_Target">, AutoNormalizeEnum;
4951
4991
def funknown_anytype : Flag<["-"], "funknown-anytype">,
4952
4992
HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">,
4953
4993
MarshallingInfoFlag<"LangOpts->ParseUnknownAnytype">;
@@ -4966,16 +5006,21 @@ def fno_deprecated_macro : Flag<["-"], "fno-deprecated-macro">,
4966
5006
HelpText<"Undefines the __DEPRECATED macro">;
4967
5007
def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
4968
5008
HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
5009
+ // TODO: Enforce values valid for MSVtorDispMode.
4969
5010
def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
4970
- HelpText<"Control vtordisp placement on win32 targets">;
5011
+ HelpText<"Control vtordisp placement on win32 targets">,
5012
+ MarshallingInfoStringInt<"LangOpts->VtorDispMode", "1">;
4971
5013
def fnative_half_type: Flag<["-"], "fnative-half-type">,
4972
5014
HelpText<"Use the native half type for __fp16 instead of promoting to float">;
4973
5015
def fnative_half_arguments_and_returns : Flag<["-"], "fnative-half-arguments-and-returns">,
4974
5016
HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">;
4975
5017
def fallow_half_arguments_and_returns : Flag<["-"], "fallow-half-arguments-and-returns">,
4976
5018
HelpText<"Allow function arguments and returns of type half">;
4977
5019
def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,
4978
- HelpText<"Set default calling convention">, Values<"cdecl,fastcall,stdcall,vectorcall,regcall">;
5020
+ HelpText<"Set default calling convention">, Values<"cdecl,fastcall,stdcall,vectorcall,regcall">,
5021
+ NormalizedValuesScope<"LangOptions">,
5022
+ NormalizedValues<["DCC_CDecl", "DCC_FastCall", "DCC_StdCall", "DCC_VectorCall", "DCC_RegCall"]>,
5023
+ MarshallingInfoString<"LangOpts->DefaultCallingConv", "DCC_None">, AutoNormalizeEnum;
4979
5024
def finclude_default_header : Flag<["-"], "finclude-default-header">,
4980
5025
HelpText<"Include default header file for OpenCL">,
4981
5026
MarshallingInfoFlag<"LangOpts->IncludeDefaultHeader">;
@@ -4986,7 +5031,9 @@ def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">,
4986
5031
HelpText<"Preserve 3-component vector type">,
4987
5032
MarshallingInfoFlag<"CodeGenOpts.PreserveVec3Type">;
4988
5033
def fwchar_type_EQ : Joined<["-"], "fwchar-type=">,
4989
- HelpText<"Select underlying type for wchar_t">, Values<"char,short,int">;
5034
+ HelpText<"Select underlying type for wchar_t">, Values<"char,short,int">,
5035
+ NormalizedValues<["1", "2", "4"]>,
5036
+ MarshallingInfoString<"LangOpts->WCharSize", "0">, AutoNormalizeEnum;
4990
5037
defm signed_wchar : BoolFOption<"signed-wchar",
4991
5038
"LangOpts->WCharIsSigned", DefaultsToTrue,
4992
5039
ChangedBy<NegFlag, [], "Use an unsigned">, ResetBy<PosFlag, [], "Use a signed">,
0 commit comments