Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/include/clang/Driver/Options.td
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 476 Lines • ▼ Show 20 Lines | |||||
// CompilerInvocation. | // CompilerInvocation. | ||||
multiclass BoolGOption<string flag_base, KeyPathAndMacro kpm, | multiclass BoolGOption<string flag_base, KeyPathAndMacro kpm, | ||||
Default default, FlagDef flag1, FlagDef flag2, | Default default, FlagDef flag1, FlagDef flag2, | ||||
BothFlags both = BothFlags<[], "">> { | BothFlags both = BothFlags<[], "">> { | ||||
defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>, | defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>, | ||||
Group<g_Group>; | Group<g_Group>; | ||||
} | } | ||||
// FIXME: Diagnose if target does not support protected visibility. | // FIXME: Diagnose if target does not support protected visibility. | ||||
class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default> | class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default> | ||||
awarzynski: [nit] To me `KeyPathAndMacro` is just an implementation detail. The key part is that… | |||||
: MarshallingInfoEnum<kpm, default>, | : MarshallingInfoEnum<kpm, default>, | ||||
Values<"default,hidden,internal,protected">, | Values<"default,hidden,internal,protected">, | ||||
NormalizedValues<["DefaultVisibility", "HiddenVisibility", | NormalizedValues<["DefaultVisibility", "HiddenVisibility", | ||||
"HiddenVisibility", "ProtectedVisibility"]> {} | "HiddenVisibility", "ProtectedVisibility"]> {} | ||||
// Key paths that are constant during parsing of options with the same key path prefix. | // Key paths that are constant during parsing of options with the same key path prefix. | ||||
defvar cplusplus = LangOpts<"CPlusPlus">; | defvar cplusplus = LangOpts<"CPlusPlus">; | ||||
defvar cpp11 = LangOpts<"CPlusPlus11">; | defvar cpp11 = LangOpts<"CPlusPlus11">; | ||||
▲ Show 20 Lines • Show All 4,474 Lines • ▼ Show 20 Lines | |||||
defm real_8_real_10 : BooleanFFlag<"real-8-real-10">, Group<gfortran_Group>; | defm real_8_real_10 : BooleanFFlag<"real-8-real-10">, Group<gfortran_Group>; | ||||
defm real_8_real_16 : BooleanFFlag<"real-8-real-16">, Group<gfortran_Group>; | defm real_8_real_16 : BooleanFFlag<"real-8-real-16">, Group<gfortran_Group>; | ||||
defm real_8_real_4 : BooleanFFlag<"real-8-real-4">, Group<gfortran_Group>; | defm real_8_real_4 : BooleanFFlag<"real-8-real-4">, Group<gfortran_Group>; | ||||
defm realloc_lhs : BooleanFFlag<"realloc-lhs">, Group<gfortran_Group>; | defm realloc_lhs : BooleanFFlag<"realloc-lhs">, Group<gfortran_Group>; | ||||
defm recursive : BooleanFFlag<"recursive">, Group<gfortran_Group>; | defm recursive : BooleanFFlag<"recursive">, Group<gfortran_Group>; | ||||
defm repack_arrays : BooleanFFlag<"repack-arrays">, Group<gfortran_Group>; | defm repack_arrays : BooleanFFlag<"repack-arrays">, Group<gfortran_Group>; | ||||
defm second_underscore : BooleanFFlag<"second-underscore">, Group<gfortran_Group>; | defm second_underscore : BooleanFFlag<"second-underscore">, Group<gfortran_Group>; | ||||
defm sign_zero : BooleanFFlag<"sign-zero">, Group<gfortran_Group>; | defm sign_zero : BooleanFFlag<"sign-zero">, Group<gfortran_Group>; | ||||
defm stack_arrays : BooleanFFlag<"stack-arrays">, Group<gfortran_Group>; | |||||
defm underscoring : BooleanFFlag<"underscoring">, Group<gfortran_Group>; | defm underscoring : BooleanFFlag<"underscoring">, Group<gfortran_Group>; | ||||
defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>; | defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>; | ||||
// C++ SYCL options | // C++ SYCL options | ||||
def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>, | def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>, | ||||
Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">; | Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">; | ||||
def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>, | def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>, | ||||
Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">; | Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">; | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">; | defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">; | ||||
defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">; | defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">; | ||||
defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">; | defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">; | ||||
defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">; | defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">; | ||||
def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>, | def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>, | ||||
HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">; | HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">; | ||||
def fstack_arrays : Flag<["-"], "fstack-arrays">, Group<f_Group>, | |||||
HelpText<"Attempt to allocate array temporaries on the stack, no matter their size">; | |||||
def fno_stack_arrays : Flag<["-"], "fno-stack-arrays">, Group<f_Group>, | |||||
HelpText<"Allocate array temporaries on the heap (default)">; | |||||
awarzynskiUnsubmitted We should avoid duplicating options like this and use multiclasses instead. For example, see how debug_pass_manager is defined. awarzynski: We should avoid duplicating options like this and use multiclasses instead. For example, see… | |||||
} // let Flags = [FC1Option, FlangOption, FlangOnlyOption] | } // let Flags = [FC1Option, FlangOption, FlangOnlyOption] | ||||
def J : JoinedOrSeparate<["-"], "J">, | def J : JoinedOrSeparate<["-"], "J">, | ||||
Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>, | Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>, | ||||
Group<gfortran_Group>, | Group<gfortran_Group>, | ||||
Alias<module_dir>; | Alias<module_dir>; | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
▲ Show 20 Lines • Show All 2,040 Lines • Show Last 20 Lines |
[nit] To me KeyPathAndMacro is just an implementation detail. The key part is that BoolOption does use the marshaling infra and BoolFlangOnlyOption does not. Perhaps rename as BoolOptionWithoutMarshalling? There isn't anything Flang specific here, is there?