[clang] ec58ad6 - [Driver][SYCL] Address sanitizer and test issue (#121822)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 13:39:34 PST 2025
Author: Michael Toguchi
Date: 2025-01-06T13:39:31-08:00
New Revision: ec58ad6149fb8813521973d8ba9690276e282373
URL: https://github.com/llvm/llvm-project/commit/ec58ad6149fb8813521973d8ba9690276e282373
DIFF: https://github.com/llvm/llvm-project/commit/ec58ad6149fb8813521973d8ba9690276e282373.diff
LOG: [Driver][SYCL] Address sanitizer and test issue (#121822)
The following commit:
https://github.com/llvm/llvm-project/commit/d00f65c6acd9f0e1ddae83391f55eb9d232d2f9e
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 <vitalybuka at gmail.com>
Added:
Modified:
clang/lib/Driver/ToolChains/SYCL.cpp
clang/lib/Driver/ToolChains/SYCL.h
clang/test/Driver/sycl-offload-jit.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/SYCL.cpp b/clang/lib/Driver/ToolChains/SYCL.cpp
index e42b65cc07deea..a2b07ef4824a1b 100644
--- a/clang/lib/Driver/ToolChains/SYCL.cpp
+++ b/clang/lib/Driver/ToolChains/SYCL.cpp
@@ -17,8 +17,7 @@ using namespace llvm::opt;
SYCLInstallationDetector::SYCLInstallationDetector(
const Driver &D, const llvm::Triple &HostTriple,
- const llvm::opt::ArgList &Args)
- : D(D) {}
+ const llvm::opt::ArgList &Args) {}
void SYCLInstallationDetector::addSYCLIncludeArgs(
const ArgList &DriverArgs, ArgStringList &CC1Args) const {
@@ -31,8 +30,8 @@ void SYCLInstallationDetector::addSYCLIncludeArgs(
}
// Unsupported options for SYCL device compilation.
-static ArrayRef<OptSpecifier> getUnsupportedOpts() {
- return {
+static ArrayRef<options::ID> getUnsupportedOpts() {
+ static constexpr options::ID UnsupportedOpts[] = {
options::OPT_fsanitize_EQ, // -fsanitize
options::OPT_fcf_protection_EQ, // -fcf-protection
options::OPT_fprofile_generate,
@@ -53,7 +52,9 @@ static ArrayRef<OptSpecifier> getUnsupportedOpts() {
options::OPT_fprofile_instr_use_EQ, // -fprofile-instr-use
options::OPT_forder_file_instrumentation, // -forder-file-instrumentation
options::OPT_fcs_profile_generate, // -fcs-profile-generate
- options::OPT_fcs_profile_generate_EQ};
+ options::OPT_fcs_profile_generate_EQ,
+ };
+ return UnsupportedOpts;
}
SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
diff --git a/clang/lib/Driver/ToolChains/SYCL.h b/clang/lib/Driver/ToolChains/SYCL.h
index 9af2fd0c45c5ed..2a8b4eca9e9f82 100644
--- a/clang/lib/Driver/ToolChains/SYCL.h
+++ b/clang/lib/Driver/ToolChains/SYCL.h
@@ -22,9 +22,6 @@ class SYCLInstallationDetector {
void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const;
-
-private:
- const Driver &D;
};
namespace toolchains {
diff --git a/clang/test/Driver/sycl-offload-jit.cpp b/clang/test/Driver/sycl-offload-jit.cpp
index d7ab630084098e..eb192e08a3bc0c 100644
--- a/clang/test/Driver/sycl-offload-jit.cpp
+++ b/clang/test/Driver/sycl-offload-jit.cpp
@@ -3,7 +3,7 @@
/// Check the phases graph with -fsycl. Use of -fsycl enables offload
// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl %s 2>&1 \
// RUN: | FileCheck -check-prefixes=CHK-PHASES %s
-// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl %s 2>&1 \
+// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -- %s 2>&1 \
// RUN: | FileCheck -check-prefixes=CHK-PHASES %s
// CHK-PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl)
// CHK-PHASES-NEXT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
@@ -35,7 +35,7 @@
// RUN: | FileCheck -check-prefixes=CHK-FSYCL-IS-DEVICE,CHK-FSYCL-IS-HOST %s
// RUN: %clang -### -fsycl -fsycl-device-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-FSYCL-IS-DEVICE %s
-// RUN: %clang_cl -### -fsycl -c %s 2>&1 \
+// RUN: %clang_cl -### -fsycl -c -- %s 2>&1 \
// RUN: | FileCheck -check-prefixes=CHK-FSYCL-IS-DEVICE,CHK-FSYCL-IS-HOST %s
// RUN: %clang -### -fsycl -fsycl-host-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-FSYCL-IS-HOST %s
More information about the cfe-commits
mailing list