Skip to content

Commit

Permalink
[Driver][SYCL] Disable the warning when fsycl-host-compiler is used (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
hchilama authored Dec 17, 2021
1 parent 927fb89 commit 756c2e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ def fsycl_libspirv_path_EQ : Joined<["-"], "fsycl-libspirv-path=">,
Flags<[CC1Option, CoreOption]>, HelpText<"Path to libspirv library">;
def fno_sycl_libspirv : Flag<["-"], "fno-sycl-libspirv">, Flags<[CoreOption]>, HelpText<"Disable check for libspirv">;
def fsycl_host_compiler_EQ : Joined<["-"], "fsycl-host-compiler=">,
Flags<[CoreOption]>, HelpText<"Specify C++ compiler binary to perform host "
Flags<[CoreOption, NoArgumentUnused]>, HelpText<"Specify C++ compiler binary to perform host "
"compilation with during SYCL offload compiles.">;
def fsycl_host_compiler_options_EQ : Joined<["-"], "fsycl-host-compiler-options=">,
Flags<[CoreOption]>, HelpText<"When performing the host compilation with "
Expand Down
6 changes: 6 additions & 0 deletions clang/test/Driver/sycl-host-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@
// RUN: %clangxx -fsycl -fsycl-host-compiler= -c -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=HOST_COMPILER_NOARG %s
// HOST_COMPILER_NOARG: missing argument to '-fsycl-host-compiler='

/// Warning should not be emitted when using -fsycl-host-compiler when linking
// RUN: touch %t.o
// RUN: %clangxx -fsycl -fsycl-host-compiler=g++ %t.o -### 2>&1 \
// RUN: | FileCheck -check-prefix=WARNING_HOST_COMPILER %s
// WARNING_HOST_COMPILER-NOT: warning: argument unused during compilation: '-fsycl-host-compiler=g++' [-Wunused-command-line-argument]

0 comments on commit 756c2e8

Please sign in to comment.