Skip to content

Commit 3398497

Browse files
committed
Improve warning message for deprecated -fsycl-targets arguments.
1 parent 881c200 commit 3398497

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,6 @@ def err_drv_fsycl_with_c_type : Error<
295295
def warn_drv_sycl_offload_target_duplicate : Warning<
296296
"SYCL offloading target '%0' is similar to target '%1' already specified; "
297297
"will be ignored">, InGroup<SyclTarget>;
298-
def warn_drv_sycl_deprecated_triple_component : Warning<"'%0' component of '%1'"
299-
" SYCL offloading target triple is deprecated; using '%2' instead">,
300-
InGroup<SyclTarget>;
301298
def err_drv_omp_offload_target_missingbcruntime : Error<
302299
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Please use --libomptarget-%1-bc-path to specify %1 bitcode library.">;
303300
def err_drv_omp_offload_target_bcruntime_not_found : Error<"Bitcode library '%0' does not exist.">;

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -925,13 +925,13 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
925925

926926
// Warn about deprecated `sycldevice` environment component.
927927
if (TT.getEnvironmentName() == "sycldevice") {
928+
Diag(clang::diag::warn_drv_deprecated_arg)
929+
<< TT.str() << TT.getArchName();
930+
// Drop environment component.
928931
std::string EffectiveTriple =
929932
Twine(TT.getArchName() + "-" + TT.getVendorName() + "-" +
930933
TT.getOSName())
931934
.str();
932-
Diag(clang::diag::warn_drv_sycl_deprecated_triple_component)
933-
<< TT.getEnvironmentName() << TT.str() << EffectiveTriple;
934-
// Drop environment component.
935935
TT.setTriple(EffectiveTriple);
936936
}
937937

clang/test/Driver/sycl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// DISABLED-NOT: "-fsycl-std-layout-kernel-params"
3030

3131
// RUN: %clangxx -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -c %s 2>&1 | FileCheck %s --check-prefix=CHECK_WARNING
32-
// CHECK_WARNING: 'sycldevice' component of 'spir64-unknown-unknown-sycldevice' SYCL offloading target triple is deprecated; using 'spir64-unknown-unknown' instead
32+
// CHECK_WARNING: argument 'spir64-unknown-unknown-sycldevice' is deprecated, use 'spir64' instead
3333

3434
// RUN: %clang -### -fsycl-device-only -c %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
3535
// RUN: %clang -### -fsycl-device-only %s 2>&1 | FileCheck %s --check-prefix=DEFAULT

0 commit comments

Comments
 (0)