Skip to content

Commit f679705

Browse files
committed
Revert D135076 "[Clang] Make offloading flags accept '-' and '--'"
This reverts commit 11adae5. There are multiple aspects this change is not appealing. * They conflict with JoinedOrSeparate `-o`. The old exception `-objc-*` should not be used an excuse. * We generally want new options to be more rigid and avoid multiple spellings. * If users get used to `-offload-*`, a misspelled `-offload-*` option still gets passed as `-o ffloat-*` without being detected.
1 parent d420110 commit f679705

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">, Group<Compi
833833
def z : Separate<["-"], "z">, Flags<[LinkerInput]>,
834834
HelpText<"Pass -z <arg> to the linker">, MetaVarName<"<arg>">,
835835
Group<Link_Group>;
836-
def offload_link : Flag<["--", "-"], "offload-link">, Group<Link_Group>,
836+
def offload_link : Flag<["--"], "offload-link">, Group<Link_Group>,
837837
HelpText<"Use the new offloading linker to perform the link job.">;
838838
def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
839839
HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
@@ -933,7 +933,7 @@ def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOpt
933933
HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
934934
def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>,
935935
HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
936-
def offload_arch_EQ : Joined<["--", "-"], "offload-arch=">, Flags<[NoXarchOption]>,
936+
def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
937937
HelpText<"CUDA offloading device architecture (e.g. sm_35), or HIP offloading target ID in the form of a "
938938
"device architecture followed by target ID features delimited by a colon. Each target ID feature "
939939
"is a pre-defined string followed by a plus or minus sign (e.g. gfx908:xnack+:sramecc-). May be "
@@ -945,7 +945,7 @@ def hip_link : Flag<["--"], "hip-link">,
945945
HelpText<"Link clang-offload-bundler bundles for HIP">;
946946
def no_hip_rt: Flag<["-"], "no-hip-rt">,
947947
HelpText<"Do not link against HIP runtime libraries">;
948-
def no_offload_arch_EQ : Joined<["--", "-"], "no-offload-arch=">, Flags<[NoXarchOption]>,
948+
def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>,
949949
HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
950950
"'all' resets the list to its default value.">;
951951
def emit_static_lib : Flag<["--"], "emit-static-lib">,
@@ -1187,7 +1187,7 @@ defm autolink : BoolFOption<"autolink",
11871187
// In the future this option will be supported by other offloading
11881188
// languages and accept other values such as CPU/GPU architectures,
11891189
// offload kinds and target aliases.
1190-
def offload_EQ : CommaJoined<["--", "-"], "offload=">, Flags<[NoXarchOption]>,
1190+
def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
11911191
HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">;
11921192

11931193
// C++ Coroutines TS
@@ -2626,15 +2626,15 @@ defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
26262626
PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden]>>;
26272627
def static_openmp: Flag<["-"], "static-openmp">,
26282628
HelpText<"Use the static host OpenMP runtime while linking.">;
2629-
def offload_new_driver : Flag<["--", "-"], "offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
2629+
def offload_new_driver : Flag<["--"], "offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
26302630
MarshallingInfoFlag<LangOpts<"OffloadingNewDriver">>, HelpText<"Use the new driver for offloading compilation.">;
2631-
def no_offload_new_driver : Flag<["--", "-"], "no-offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
2631+
def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
26322632
HelpText<"Don't Use the new driver for offloading compilation.">;
2633-
def offload_device_only : Flag<["--", "-"], "offload-device-only">,
2633+
def offload_device_only : Flag<["--"], "offload-device-only">,
26342634
HelpText<"Only compile for the offloading device.">;
2635-
def offload_host_only : Flag<["--", "-"], "offload-host-only">,
2635+
def offload_host_only : Flag<["--"], "offload-host-only">,
26362636
HelpText<"Only compile for the offloading host.">;
2637-
def offload_host_device : Flag<["--", "-"], "offload-host-device">,
2637+
def offload_host_device : Flag<["--"], "offload-host-device">,
26382638
HelpText<"Only compile for the offloading host.">;
26392639
def cuda_device_only : Flag<["--"], "cuda-device-only">, Alias<offload_device_only>,
26402640
HelpText<"Compile CUDA code for device only">;

0 commit comments

Comments
 (0)