Skip to content

Commit d7cfa0e

Browse files
committed
[Driver][SYCL] Suppress warning emitted when compiling wrapped object
After the switch to using clang to build the wrapped object the embedded target in the IR is caused a warning to be emitted. Suppress this warning by passing -Wno-override-module. Warning emitted: warning: overriding the module target triple with x86_64-pc-windows-msvc19.29.30154 [-Woverride-module]
1 parent 2a97b05 commit d7cfa0e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10344,9 +10344,13 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1034410344

1034510345
if (WrapperCompileEnabled) {
1034610346
// TODO Use TC.SelectTool().
10347+
// Pass -Wno-override-module to the compilation to restrict the warning
10348+
// that is emitted due to the target in the generated IR from the wrapping
10349+
// step.
1034710350
ArgStringList ClangArgs{
10348-
TCArgs.MakeArgString("--target=" + TC.getAuxTriple()->str()), "-c",
10349-
"-o", Output.getFilename(), WrapperFileName};
10351+
TCArgs.MakeArgString("--target=" + TC.getAuxTriple()->str()),
10352+
"-Wno-override-module", "-c", "-o", Output.getFilename(),
10353+
WrapperFileName};
1035010354
llvm::Reloc::Model RelocationModel;
1035110355
unsigned PICLevel;
1035210356
bool IsPIE;

clang/test/Driver/sycl-offload-aot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
// CHK-TOOLS-FPGA: clang-offload-wrapper{{.*}} "-o=[[OUTPUT5:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_fpga{{.*}}" "-kind=sycl" "-batch" "[[OUTPUT4]]"
157157
// CHK-TOOLS-GEN: clang-offload-wrapper{{.*}} "-o=[[OUTPUT5:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_gen{{.*}}" "-kind=sycl" "-batch" "[[OUTPUT4]]"
158158
// CHK-TOOLS-CPU: clang-offload-wrapper{{.*}} "-o=[[OUTPUT5:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_x86_64{{.*}}" "-kind=sycl" "-batch" "[[OUTPUT4]]"
159-
// CHK-TOOLS-AOT: clang{{.*}} "-c" "-o" "[[OUTPUT6:.+\.o]]" "[[OUTPUT5]]"
159+
// CHK-TOOLS-AOT: clang{{.*}} "-Wno-override-module" "-c" "-o" "[[OUTPUT6:.+\.o]]" "[[OUTPUT5]]"
160160
// CHK-TOOLS-AOT: ld{{.*}} "[[OUTPUT7]]" "[[OUTPUT6]]" {{.*}} "-lsycl"
161161

162162
// Check to be sure that for windows, the 'exe' tools are called

clang/test/Driver/sycl-offload-with-split-old-model.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
// CHK-TOOLS-FPGA: clang-offload-wrapper{{.*}} "-o=[[OUTPUT8:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_fpga" "-kind=sycl" "-batch" "[[OUTPUT7]]"
212212
// CHK-TOOLS-GEN: clang-offload-wrapper{{.*}} "-o=[[OUTPUT8:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_gen" "-kind=sycl" "-batch" "[[OUTPUT7]]"
213213
// CHK-TOOLS-CPU: clang-offload-wrapper{{.*}} "-o=[[OUTPUT8:.+\.bc]]" "-host=x86_64-unknown-linux-gnu" "-target=spir64_x86_64" "-kind=sycl" "-batch" "[[OUTPUT7]]"
214-
// CHK-TOOLS-AOT: clang{{.*}} "-c" "-o" "[[OUTPUT9:.+\.o]]" "[[OUTPUT8]]"
214+
// CHK-TOOLS-AOT: clang{{.*}} "-Wno-override-module" "-c" "-o" "[[OUTPUT9:.+\.o]]" "[[OUTPUT8]]"
215215
// CHK-TOOLS-AOT: ld{{.*}} "[[OUTPUT10]]" "[[OUTPUT9]]" {{.*}} "-lsycl"
216216

217217
/// ###########################################################################

0 commit comments

Comments
 (0)