[clang] [SYCL] change sycl version accrodnig to standard (PR #114790)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 19 06:03:41 PST 2024
https://github.com/dklochkov-emb updated https://github.com/llvm/llvm-project/pull/114790
>From 962fcac610226d5bbd0ed84d7c3dc111d1bafa4f Mon Sep 17 00:00:00 2001
From: "Klochkov, Denis" <denis.klochkov at intel.com>
Date: Mon, 4 Nov 2024 04:58:30 -0800
Subject: [PATCH 1/2] [SYCL] change sycl version accrodnig to standard
---
clang/lib/Frontend/InitPreprocessor.cpp | 2 +-
clang/test/Preprocessor/sycl-macro.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 9a0fdb175ff29e..e9c7dc338380fd 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -587,7 +587,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017)
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020)
- Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");
+ Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202012");
}
// Not "standard" per se, but available even with the -undef flag.
diff --git a/clang/test/Preprocessor/sycl-macro.cpp b/clang/test/Preprocessor/sycl-macro.cpp
index eecddaa09d1c33..a509086f99e413 100644
--- a/clang/test/Preprocessor/sycl-macro.cpp
+++ b/clang/test/Preprocessor/sycl-macro.cpp
@@ -10,5 +10,5 @@
// CHECK-NOT:#define __SYCL_DEVICE_ONLY__ 1
// CHECK-NOT:#define CL_SYCL_LANGUAGE_VERSION 121
// CHECK-SYCL-STD:#define CL_SYCL_LANGUAGE_VERSION 121
-// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202001
+// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202012
// CHECK-SYCL:#define __SYCL_DEVICE_ONLY__ 1
>From 691adc00b7e3879d9d3812abdbd526d97e447457 Mon Sep 17 00:00:00 2001
From: "Klochkov, Denis" <denis.klochkov at intel.com>
Date: Tue, 19 Nov 2024 06:03:25 -0800
Subject: [PATCH 2/2] [SYCL] make sycl version long integer
---
clang/lib/Frontend/InitPreprocessor.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index e9c7dc338380fd..a90807d6fa6f0b 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -587,7 +587,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017)
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020)
- Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202012");
+ Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202012L");
}
// Not "standard" per se, but available even with the -undef flag.
More information about the cfe-commits
mailing list