Skip to content

Commit 20248cf

Browse files
authored
[SYCL][NFC] Fix internal option name prefix (#848)
Align internal variable name with the driver option name. Option name `-fsycl-device-only`. Variable name `sycl_device_only` -> `fsycl_device_only`. Signed-off-by: Alexey Bader <[email protected]>
1 parent a527b95 commit 20248cf

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,8 @@ def fintelfpga : Flag<["-"], "fintelfpga">, Group<f_Group>,
18141814
def fsycl : Flag<["-"], "fsycl">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, CoreOption]>,
18151815
HelpText<"generate SYCL code.">;
18161816
def fno_sycl : Flag<["-"], "fno-sycl">, Group<f_Group>, Flags<[NoArgumentUnused, CoreOption]>;
1817+
def fsycl_device_only : Flag<["-"], "fsycl-device-only">, Flags<[CoreOption]>,
1818+
HelpText<"Compile SYCL kernels for device">;
18171819
def fsycl_targets_EQ : CommaJoined<["-"], "fsycl-targets=">, Flags<[DriverOption, CC1Option, CoreOption]>,
18181820
HelpText<"Specify comma-separated list of triples SYCL offloading targets to be supported">;
18191821
def fsycl_add_targets_EQ : CommaJoined<["-"], "fsycl-add-targets=">, Flags<[DriverOption, CoreOption]>,
@@ -3396,9 +3398,6 @@ defm stack_arrays : BooleanFFlag<"stack-arrays">, Group<gfortran_Group>;
33963398
defm underscoring : BooleanFFlag<"underscoring">, Group<gfortran_Group>;
33973399
defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>;
33983400

3399-
def sycl_device_only : Flag<["-"], "fsycl-device-only">, Flags<[CoreOption]>,
3400-
HelpText<"Compile SYCL kernels for device">;
3401-
34023401
def reuse_exe_EQ : Joined<["-"], "reuse-exe=">,
34033402
HelpText<"Speed up FPGA aoc compile if the device code in <exe> is unchanged.">,
34043403
MetaVarName<"<exe>">;

clang/lib/Driver/Driver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ phases::ID Driver::getFinalPhase(const DerivedArgList &DAL,
299299

300300
// -S only runs up to the backend.
301301
} else if ((PhaseArg = DAL.getLastArg(options::OPT_S)) ||
302-
(PhaseArg = DAL.getLastArg(options::OPT_sycl_device_only))) {
302+
(PhaseArg = DAL.getLastArg(options::OPT_fsycl_device_only))) {
303303
FinalPhase = phases::Backend;
304304

305305
// -c compilation only runs up to the assembler.
@@ -730,7 +730,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
730730
// Use of -fsycl-device-only overrides -fsycl.
731731
bool HasValidSYCLRuntime = (C.getInputArgs().hasFlag(options::OPT_fsycl,
732732
options::OPT_fno_sycl, false) &&
733-
!C.getInputArgs().hasArg(options::OPT_sycl_device_only));
733+
!C.getInputArgs().hasArg(options::OPT_fsycl_device_only));
734734

735735
// A mechanism for retrieving SYCL-specific options, erroring out
736736
// if SYCL offloading wasn't enabled prior to that
@@ -1201,7 +1201,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
12011201
T.setObjectFormat(llvm::Triple::COFF);
12021202
TargetTriple = T.str();
12031203
}
1204-
if (Args.hasArg(options::OPT_sycl_device_only)) {
1204+
if (Args.hasArg(options::OPT_fsycl_device_only)) {
12051205
// -fsycl-device-only implies spir arch and SYCL Device
12061206
llvm::Triple T(TargetTriple);
12071207
// FIXME: defaults to spir64, should probably have a way to set spir
@@ -4486,7 +4486,7 @@ Action *Driver::ConstructPhaseAction(
44864486
Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
44874487
return C.MakeAction<BackendJobAction>(Input, Output);
44884488
}
4489-
if (Args.hasArg(options::OPT_sycl_device_only)) {
4489+
if (Args.hasArg(options::OPT_fsycl_device_only)) {
44904490
if (Args.hasFlag(options::OPT_fsycl_use_bitcode,
44914491
options::OPT_fno_sycl_use_bitcode, true))
44924492
return C.MakeAction<BackendJobAction>(Input, types::TY_LLVM_BC);

clang/lib/Driver/Types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void types::getCompilationPhases(const clang::driver::Driver &Driver,
362362

363363
else if (DAL.getLastArg(options::OPT_S) ||
364364
DAL.getLastArg(options::OPT_emit_llvm) ||
365-
DAL.getLastArg(options::OPT_sycl_device_only))
365+
DAL.getLastArg(options::OPT_fsycl_device_only))
366366
llvm::copy_if(PhaseList, std::back_inserter(P),
367367
[](phases::ID Phase) { return Phase <= phases::Backend; });
368368

0 commit comments

Comments
 (0)