Skip to content

Commit 756c2e8

Browse files
authored
[Driver][SYCL] Disable the warning when fsycl-host-compiler is used (#5124)
The warning is emitted because we aren't doing any host compilation at that point. But the warning can be misleading to the users, they may think there is something inappropriate with usage of -fsycl-host-compiler. So instead of asking user not to use the option we are just ignoring the warning.
1 parent 927fb89 commit 756c2e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2699,7 +2699,7 @@ def fsycl_libspirv_path_EQ : Joined<["-"], "fsycl-libspirv-path=">,
26992699
Flags<[CC1Option, CoreOption]>, HelpText<"Path to libspirv library">;
27002700
def fno_sycl_libspirv : Flag<["-"], "fno-sycl-libspirv">, Flags<[CoreOption]>, HelpText<"Disable check for libspirv">;
27012701
def fsycl_host_compiler_EQ : Joined<["-"], "fsycl-host-compiler=">,
2702-
Flags<[CoreOption]>, HelpText<"Specify C++ compiler binary to perform host "
2702+
Flags<[CoreOption, NoArgumentUnused]>, HelpText<"Specify C++ compiler binary to perform host "
27032703
"compilation with during SYCL offload compiles.">;
27042704
def fsycl_host_compiler_options_EQ : Joined<["-"], "fsycl-host-compiler-options=">,
27052705
Flags<[CoreOption]>, HelpText<"When performing the host compilation with "

clang/test/Driver/sycl-host-compiler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@
6262
// RUN: %clangxx -fsycl -fsycl-host-compiler= -c -### %s 2>&1 \
6363
// RUN: | FileCheck -check-prefix=HOST_COMPILER_NOARG %s
6464
// HOST_COMPILER_NOARG: missing argument to '-fsycl-host-compiler='
65+
66+
/// Warning should not be emitted when using -fsycl-host-compiler when linking
67+
// RUN: touch %t.o
68+
// RUN: %clangxx -fsycl -fsycl-host-compiler=g++ %t.o -### 2>&1 \
69+
// RUN: | FileCheck -check-prefix=WARNING_HOST_COMPILER %s
70+
// WARNING_HOST_COMPILER-NOT: warning: argument unused during compilation: '-fsycl-host-compiler=g++' [-Wunused-command-line-argument]

0 commit comments

Comments
 (0)