Skip to content

Commit 9ddb8f0

Browse files
authored
[SYCL] Correct some driver diagnostic wording
Clang diagnostics do not start with a capital letter or use trailing punctuation. This corrects some of the SYCL diagnostics accordingly, but more work needs to be done upstream for other diagnostics in the file.
1 parent 1308fe7 commit 9ddb8f0

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

+7-6
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ def warn_drv_unknown_cuda_version: Warning<
7979
InGroup<CudaUnknownVersion>;
8080
def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compilation.">;
8181
def err_drv_no_sycl_libspirv : Error<
82-
"cannot find `libspirv-nvptx64--nvidiacl.bc`. Provide path to libspirv library via "
83-
"-fsycl-libspirv-path, or pass -fno-sycl-libspirv to build without linking with libspirv.">;
82+
"cannot find 'libspirv-nvptx64--nvidiacl.bc'; provide path to libspirv "
83+
"library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build "
84+
"without linking with libspirv">;
8485
def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">;
8586
def err_drv_bad_target_id : Error<"Invalid target ID: %0 (A target ID is a processor name "
8687
"followed by an optional list of predefined features post-fixed by a plus or minus sign deliminated "
@@ -285,12 +286,12 @@ def err_drv_omp_host_target_not_supported : Error<
285286
def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
286287
"The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">;
287288
def err_drv_expecting_fsycl_with_sycl_opt : Error<
288-
"The option %0 must be used in conjunction with -fsycl to enable offloading.">;
289+
"'%0' must be used in conjunction with '-fsycl' to enable offloading">;
289290
def err_drv_fsycl_with_c_type : Error<
290-
"The option '%0' must not be used in conjunction with '-fsycl', which expects C++ source.">;
291+
"'%0' must not be used in conjunction with '-fsycl', which expects C++ source">;
291292
def warn_drv_sycl_offload_target_duplicate : Warning<
292-
"The SYCL offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
293-
InGroup<SyclTarget>;
293+
"SYCL offloading target '%0' is similar to target '%1' already specified; "
294+
"will be ignored">, InGroup<SyclTarget>;
294295
def err_drv_omp_offload_target_missingbcruntime : Error<
295296
"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.">;
296297
def err_drv_omp_offload_target_bcruntime_not_found : Error<"Bitcode library '%0' does not exist.">;

clang/test/Driver/sycl-libspirv-invalid.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
77
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/no-libspirv-exists-here.bc %s 2>&1 \
88
// RUN: | FileCheck --check-prefix=ERR %s
9-
// ERR: cannot find `libspirv-nvptx64--nvidiacl.bc`
9+
// ERR: cannot find 'libspirv-nvptx64--nvidiacl.bc'
1010

1111
// RUN: %clangxx -### -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \
1212
// RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
1313
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/no-libspirv-exists-here.bc -fno-sycl-libspirv %s 2>&1 \
1414
// RUN: | FileCheck --check-prefix=OK %s
15-
// OK-NOT: cannot find `libspirv-nvptx64--nvidiacl.bc`
15+
// OK-NOT: cannot find 'libspirv-nvptx64--nvidiacl.bc'

clang/test/Driver/sycl-offload.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@
4444
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s
4545
// RUN: %clang_cl -### -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
4646
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s
47-
// CHK-NO-FSYCL: error: The option -fsycl-targets must be used in conjunction with -fsycl to enable offloading.
47+
// CHK-NO-FSYCL: error: '-fsycl-targets' must be used in conjunction with '-fsycl' to enable offloading
4848
// RUN: %clang -### -fsycl-link-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
4949
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-LINK-TGTS %s
50-
// CHK-NO-FSYCL-LINK-TGTS: error: The option -fsycl-link-targets must be used in conjunction with -fsycl to enable offloading.
50+
// CHK-NO-FSYCL-LINK-TGTS: error: '-fsycl-link-targets' must be used in conjunction with '-fsycl' to enable offloading
5151
// RUN: %clang -### -fsycl-add-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
5252
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-ADD %s
53-
// CHK-NO-FSYCL-ADD: error: The option -fsycl-add-targets must be used in conjunction with -fsycl to enable offloading.
53+
// CHK-NO-FSYCL-ADD: error: '-fsycl-add-targets' must be used in conjunction with '-fsycl' to enable offloading
5454
// RUN: %clang -### -fsycl-link %s 2>&1 \
5555
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-LINK %s
56-
// CHK-NO-FSYCL-LINK: error: The option -fsycl-link must be used in conjunction with -fsycl to enable offloading.
56+
// CHK-NO-FSYCL-LINK: error: '-fsycl-link' must be used in conjunction with '-fsycl' to enable offloading
5757
// RUN: %clang -### -fintelfpga %s 2>&1 \
5858
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-FINTELFPGA %s
59-
// CHK-NO-FSYCL-FINTELFPGA: error: The option -fintelfpga must be used in conjunction with -fsycl to enable offloading.
59+
// CHK-NO-FSYCL-FINTELFPGA: error: '-fintelfpga' must be used in conjunction with '-fsycl' to enable offloading
6060

6161
/// ###########################################################################
6262

@@ -142,7 +142,7 @@
142142
/// Check warning for duplicate offloading targets.
143143
// RUN: %clang -### -ccc-print-phases -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64-unknown-unknown-sycldevice %s 2>&1 \
144144
// RUN: | FileCheck -check-prefix=CHK-DUPLICATES %s
145-
// CHK-DUPLICATES: warning: The SYCL offloading target 'spir64-unknown-unknown-sycldevice' is similar to target 'spir64-unknown-unknown-sycldevice' already specified - will be ignored.
145+
// CHK-DUPLICATES: warning: SYCL offloading target 'spir64-unknown-unknown-sycldevice' is similar to target 'spir64-unknown-unknown-sycldevice' already specified; will be ignored
146146

147147
/// ###########################################################################
148148

@@ -916,7 +916,7 @@
916916
// RUN: %clangxx -### -c -fsycl -xc %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
917917
// RUN: %clangxx -### -c -fsycl -xc-header %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
918918
// RUN: %clangxx -### -c -fsycl -xcpp-output %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
919-
// CHECK_XC_FSYCL: The option '-x c{{.*}}' must not be used in conjunction with '-fsycl'
919+
// CHECK_XC_FSYCL: '-x c{{.*}}' must not be used in conjunction with '-fsycl'
920920

921921
// -std=c++17 check (check all 3 compilations)
922922
// RUN: %clangxx -### -c -fsycl -xc++ %s 2>&1 | FileCheck -check-prefix=CHECK-STD %s

0 commit comments

Comments
 (0)