Skip to content

Commit ec58ad6

Browse files
[Driver][SYCL] Address sanitizer and test issue (#121822)
The following commit: d00f65c Caused sanitizer build issues and also a test issue when using %clang_cl. Address these problems. - Use local static array - Use '--' for clang_cl calls --------- Co-authored-by: Vitaly Buka <[email protected]>
1 parent f06d4d9 commit ec58ad6

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ using namespace llvm::opt;
1717

1818
SYCLInstallationDetector::SYCLInstallationDetector(
1919
const Driver &D, const llvm::Triple &HostTriple,
20-
const llvm::opt::ArgList &Args)
21-
: D(D) {}
20+
const llvm::opt::ArgList &Args) {}
2221

2322
void SYCLInstallationDetector::addSYCLIncludeArgs(
2423
const ArgList &DriverArgs, ArgStringList &CC1Args) const {
@@ -31,8 +30,8 @@ void SYCLInstallationDetector::addSYCLIncludeArgs(
3130
}
3231

3332
// Unsupported options for SYCL device compilation.
34-
static ArrayRef<OptSpecifier> getUnsupportedOpts() {
35-
return {
33+
static ArrayRef<options::ID> getUnsupportedOpts() {
34+
static constexpr options::ID UnsupportedOpts[] = {
3635
options::OPT_fsanitize_EQ, // -fsanitize
3736
options::OPT_fcf_protection_EQ, // -fcf-protection
3837
options::OPT_fprofile_generate,
@@ -53,7 +52,9 @@ static ArrayRef<OptSpecifier> getUnsupportedOpts() {
5352
options::OPT_fprofile_instr_use_EQ, // -fprofile-instr-use
5453
options::OPT_forder_file_instrumentation, // -forder-file-instrumentation
5554
options::OPT_fcs_profile_generate, // -fcs-profile-generate
56-
options::OPT_fcs_profile_generate_EQ};
55+
options::OPT_fcs_profile_generate_EQ,
56+
};
57+
return UnsupportedOpts;
5758
}
5859

5960
SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,

clang/lib/Driver/ToolChains/SYCL.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class SYCLInstallationDetector {
2222

2323
void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
2424
llvm::opt::ArgStringList &CC1Args) const;
25-
26-
private:
27-
const Driver &D;
2825
};
2926

3027
namespace toolchains {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// Check the phases graph with -fsycl. Use of -fsycl enables offload
44
// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl %s 2>&1 \
55
// RUN: | FileCheck -check-prefixes=CHK-PHASES %s
6-
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl %s 2>&1 \
6+
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -- %s 2>&1 \
77
// RUN: | FileCheck -check-prefixes=CHK-PHASES %s
88
// CHK-PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl)
99
// CHK-PHASES-NEXT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
@@ -35,7 +35,7 @@
3535
// RUN: | FileCheck -check-prefixes=CHK-FSYCL-IS-DEVICE,CHK-FSYCL-IS-HOST %s
3636
// RUN: %clang -### -fsycl -fsycl-device-only %s 2>&1 \
3737
// RUN: | FileCheck -check-prefix=CHK-FSYCL-IS-DEVICE %s
38-
// RUN: %clang_cl -### -fsycl -c %s 2>&1 \
38+
// RUN: %clang_cl -### -fsycl -c -- %s 2>&1 \
3939
// RUN: | FileCheck -check-prefixes=CHK-FSYCL-IS-DEVICE,CHK-FSYCL-IS-HOST %s
4040
// RUN: %clang -### -fsycl -fsycl-host-only %s 2>&1 \
4141
// RUN: | FileCheck -check-prefix=CHK-FSYCL-IS-HOST %s

0 commit comments

Comments
 (0)