diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9da42102ff4b..70997bd498de 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -167,7 +167,11 @@ def hip_Group : OptionGroup<"">, Group, def m_Group : OptionGroup<"">, Group, DocName<"Target-dependent compilation options">, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CLOption, FlangOption]>; +#else Visibility<[ClangOption, CLOption]>; +#endif // Feature groups - these take command line options that correspond directly to // target specific features and can be translated directly from command line @@ -199,10 +203,18 @@ def m_wasm_Features_Group : OptionGroup<"">, def m_wasm_Features_Driver_Group : OptionGroup<"">, Group, DocName<"WebAssembly Driver">; def m_x86_Features_Group : OptionGroup<"">, +#ifdef ENABLE_CLASSIC_FLANG + Group, Visibility<[ClangOption, CLOption, FlangOption]>, +#else Group, Visibility<[ClangOption, CLOption]>, +#endif DocName<"X86">; def m_x86_AVX10_Features_Group : OptionGroup<"">, +#ifdef ENABLE_CLASSIC_FLANG + Group, Visibility<[ClangOption, CLOption, FlangOption]>, +#else Group, Visibility<[ClangOption, CLOption]>, +#endif DocName<"X86 AVX10">; def m_riscv_Features_Group : OptionGroup<"">, Group, DocName<"RISC-V">; @@ -768,10 +780,22 @@ def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>, Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>; def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group; -def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, #ifdef ENABLE_CLASSIC_FLANG +def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, Visibility<[ClangOption, FlangOption]>, -#endif + HelpText<"Search $prefix$file for executables, libraries, and data files. " + "If $prefix is a directory, search $prefix/$file">; +def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">, + Visibility<[ClangOption, FlangOption]>, + HelpText<"Use GCC installation in the specified directory. The directory ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. " + "Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation">; +def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, FlangOption]>, + HelpText< + "Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. " + "Clang will use the GCC installation with the largest version">; +#else +def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, HelpText<"Search $prefix$file for executables, libraries, and data files. " "If $prefix is a directory, search $prefix/$file">; def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">, @@ -780,6 +804,7 @@ def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">, def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>, HelpText<"Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. " "Clang will use the GCC installation with the largest version">; +#endif def gcc_triple_EQ : Joined<["--"], "gcc-triple=">, HelpText<"Search for the GCC installation with the specified triple.">; def CC : Flag<["-"], "CC">, Visibility<[ClangOption, CC1Option]>, @@ -3255,7 +3280,11 @@ defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers" def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group, HelpText<"Disable the use of stack protectors">; def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, +#else Visibility<[ClangOption, CLOption, DXCOption]>, +#endif HelpText<"Disable optimizations based on strict aliasing rules">; def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group; def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group; @@ -3387,7 +3416,12 @@ defm openmp_extensions: BoolFOption<"openmp-extensions", "Enable all Clang extensions for OpenMP directives and clauses">, NegFlag>; +#ifdef ENABLE_CLASSIC_FLANG +def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group, + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>; +#else def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group; +#endif def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group, Flags<[NoArgumentUnused, HelpHidden]>; def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group, @@ -3859,10 +3893,17 @@ def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Issue call to specified function rather than a trap instruction">, MarshallingInfoString>; +#ifdef ENABLE_CLASSIC_FLANG +def funroll_loops : Flag<["-"], "funroll-loops">, Group, + HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption]>; +def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group, + HelpText<"Turn off loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption]>; +#else def funroll_loops : Flag<["-"], "funroll-loops">, Group, HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option]>; def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group, HelpText<"Turn off loop unroller">, Visibility<[ClangOption, CC1Option]>; +#endif defm reroll_loops : BoolFOption<"reroll-loops", CodeGenOpts<"RerollLoops">, DefaultFalse, PosFlag, @@ -4458,17 +4499,29 @@ def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min= def march_EQ : Joined<["-"], "march=">, Group, Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, HelpText<"For a list of available architectures for the target use '-mcpu=help'">; +#ifdef ENABLE_CLASSIC_FLANG +def masm_EQ : Joined<["-"], "masm=">, Group, Visibility<[ClangOption, FlangOption]>; +#else def masm_EQ : Joined<["-"], "masm=">, Group; +#endif def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, Visibility<[ClangOption, CC1Option]>, Values<"att,intel">, NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["IAD_ATT", "IAD_Intel"]>, MarshallingInfoEnum, "IAD_ATT">; def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, +#else Visibility<[ClangOption, CC1Option]>, +#endif MarshallingInfoString, [{"default"}]>; def mlarge_data_threshold_EQ : Joined<["-"], "mlarge-data-threshold=">, Group, +#ifdef ENABLE_CLASSIC_FLANG + Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, +#else Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option]>, +#endif MarshallingInfoInt, "0">; def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group, Visibility<[ClangOption, CC1Option]>, @@ -5033,12 +5086,21 @@ def msoft_float : Flag<["-"], "msoft-float">, Group, def mno_fmv : Flag<["-"], "mno-fmv">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Disable function multiversioning">; +#ifdef ENABLE_CLASSIC_FLANG +def moutline_atomics : Flag<["-"], "moutline-atomics">, Group, + Visibility<[ClangOption, CC1Option, FlangOption]>, + HelpText<"Generate local calls to out-of-line atomic operations">; +def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group, + Visibility<[ClangOption, CC1Option, FlangOption]>, + HelpText<"Don't generate local calls to out-of-line atomic operations">; +#else def moutline_atomics : Flag<["-"], "moutline-atomics">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Generate local calls to out-of-line atomic operations">; def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Don't generate local calls to out-of-line atomic operations">; +#endif def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group, HelpText<"Don't generate implicit floating point or vector instructions">; def mimplicit_float : Flag<["-"], "mimplicit-float">, Group; @@ -5369,7 +5431,11 @@ def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">, Visibility<[ClangOption, CLOption]>; def print_resource_dir : Flag<["-", "--"], "print-resource-dir">, HelpText<"Print the resource directory pathname">, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CLOption, FlangOption]>; +#else Visibility<[ClangOption, CLOption]>; +#endif def print_search_dirs : Flag<["-", "--"], "print-search-dirs">, HelpText<"Print the paths used for finding libraries and programs">, Visibility<[ClangOption, CLOption]>; @@ -5406,11 +5472,19 @@ def rdynamic : Flag<["-"], "rdynamic">, Group, Visibility<[ClangOption, FlangOption]>; def resource_dir : Separate<["-"], "resource-dir">, Flags<[NoXarchOption, HelpHidden]>, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption, FC1Option]>, +#else Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>, +#endif HelpText<"The directory which holds the compiler resource files">, MarshallingInfoString>; def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption]>, +#ifdef ENABLE_CLASSIC_FLANG + Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, +#else Visibility<[ClangOption, CLOption, DXCOption]>, +#endif Alias; def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>;