@@ -438,6 +438,8 @@ defvar cplusplus = LangOpts<"CPlusPlus">;
438
438
defvar c99 = LangOpts<"C99">;
439
439
defvar lang_std = LangOpts<"LangStd">;
440
440
defvar open_cl = LangOpts<"OpenCL">;
441
+ defvar render_script = LangOpts<"RenderScript">;
442
+ defvar hip = LangOpts<"HIP">;
441
443
defvar gnu_mode = LangOpts<"GNUMode">;
442
444
443
445
defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
@@ -870,8 +872,6 @@ def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Group<i_Group>,
870
872
def fcuda_flush_denormals_to_zero : Flag<["-"], "fcuda-flush-denormals-to-zero">,
871
873
HelpText<"Flush denormal floating point values to zero in CUDA device mode.">;
872
874
def fno_cuda_flush_denormals_to_zero : Flag<["-"], "fno-cuda-flush-denormals-to-zero">;
873
- defm cuda_approx_transcendentals : OptInFFlag<"cuda-approx-transcendentals", "Use", "Don't use",
874
- " approximate transcendental functions">;
875
875
defm gpu_rdc : BoolFOption<"gpu-rdc",
876
876
LangOpts<"GPURelocatableDeviceCode">, DefaultFalse,
877
877
PosFlag<SetTrue, [CC1Option], "Generate relocatable device code, also known as separate compilation mode">,
@@ -896,8 +896,11 @@ defm hip_new_launch_api : BoolFOption<"hip-new-launch-api",
896
896
LangOpts<"HIPUseNewLaunchAPI">, DefaultFalse,
897
897
PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
898
898
BothFlags<[], " new kernel launching API for HIP">>;
899
- defm gpu_allow_device_init : OptInFFlag<"gpu-allow-device-init",
900
- "Allow", "Don't allow", " device side init function in HIP">;
899
+ defm gpu_allow_device_init : BoolFOption<"gpu-allow-device-init",
900
+ LangOpts<"GPUAllowDeviceInit">, DefaultFalse,
901
+ PosFlag<SetTrue, [CC1Option], "Allow">, NegFlag<SetFalse, [], "Don't allow">,
902
+ BothFlags<[], " device side init function in HIP">>,
903
+ ShouldParseIf<hip.KeyPath>;
901
904
defm gpu_defer_diag : BoolFOption<"gpu-defer-diag",
902
905
LangOpts<"GPUDeferDiag">, DefaultFalse,
903
906
PosFlag<SetTrue, [CC1Option], "Defer">, NegFlag<SetFalse, [], "Don't defer">,
@@ -909,7 +912,9 @@ defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-over
909
912
BothFlags<[HelpHidden], " in overloading resolution for CUDA/HIP">>;
910
913
def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
911
914
Flags<[CC1Option]>,
912
- HelpText<"Default max threads per block for kernel launch bounds for HIP">;
915
+ HelpText<"Default max threads per block for kernel launch bounds for HIP">,
916
+ MarshallingInfoStringInt<LangOpts<"GPUMaxThreadsPerBlock">, "256">,
917
+ ShouldParseIf<hip.KeyPath>;
913
918
def gpu_instrument_lib_EQ : Joined<["--"], "gpu-instrument-lib=">,
914
919
HelpText<"Instrument device library for HIP, which is a LLVM bitcode containing "
915
920
"__cyg_profile_func_enter and __cyg_profile_func_exit">;
@@ -5161,11 +5166,17 @@ def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
5161
5166
HelpText<"Control vtordisp placement on win32 targets">,
5162
5167
MarshallingInfoStringInt<LangOpts<"VtorDispMode">, "1">;
5163
5168
def fnative_half_type: Flag<["-"], "fnative-half-type">,
5164
- HelpText<"Use the native half type for __fp16 instead of promoting to float">;
5169
+ HelpText<"Use the native half type for __fp16 instead of promoting to float">,
5170
+ MarshallingInfoFlag<LangOpts<"NativeHalfType">>,
5171
+ ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath]>;
5165
5172
def fnative_half_arguments_and_returns : Flag<["-"], "fnative-half-arguments-and-returns">,
5166
- HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">;
5173
+ HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">,
5174
+ MarshallingInfoFlag<LangOpts<"NativeHalfArgsAndReturns">>,
5175
+ ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath]>;
5167
5176
def fallow_half_arguments_and_returns : Flag<["-"], "fallow-half-arguments-and-returns">,
5168
- HelpText<"Allow function arguments and returns of type half">;
5177
+ HelpText<"Allow function arguments and returns of type half">,
5178
+ MarshallingInfoFlag<LangOpts<"HalfArgsAndReturns">>,
5179
+ ImpliedByAnyOf<[fnative_half_arguments_and_returns.KeyPath]>;
5169
5180
def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,
5170
5181
HelpText<"Set default calling convention">, Values<"cdecl,fastcall,stdcall,vectorcall,regcall">,
5171
5182
NormalizedValuesScope<"LangOptions">,
@@ -5299,10 +5310,18 @@ def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
5299
5310
//===----------------------------------------------------------------------===//
5300
5311
5301
5312
def fsycl_is_device : Flag<["-"], "fsycl-is-device">,
5302
- HelpText<"Generate code for SYCL device.">;
5313
+ HelpText<"Generate code for SYCL device.">,
5314
+ MarshallingInfoFlag<LangOpts<"SYCLIsDevice">>,
5315
+ ShouldParseIf<fsycl.KeyPath>;
5303
5316
5304
5317
} // let Flags = [CC1Option, NoDriverOption]
5305
5318
5319
+ defm cuda_approx_transcendentals : BoolFOption<"cuda-approx-transcendentals",
5320
+ LangOpts<"CUDADeviceApproxTranscendentals">, DefaultFalse,
5321
+ PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
5322
+ BothFlags<[], " approximate transcendental functions">>,
5323
+ ShouldParseIf<fcuda_is_device.KeyPath>;
5324
+
5306
5325
//===----------------------------------------------------------------------===//
5307
5326
// Frontend Options - cc1 + fc1
5308
5327
//===----------------------------------------------------------------------===//
0 commit comments