summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 28656667399..020cf85c01c 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -579,10 +579,12 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
// Define macros for the OpenCL memory scope.
// The values should match clang SyncScope enum.
- assert(static_cast<unsigned>(SyncScope::OpenCLWorkGroup) == 1 &&
- static_cast<unsigned>(SyncScope::OpenCLDevice) == 2 &&
- static_cast<unsigned>(SyncScope::OpenCLAllSVMDevices) == 3 &&
- static_cast<unsigned>(SyncScope::OpenCLSubGroup) == 4);
+ static_assert(
+ static_cast<unsigned>(AtomicScopeOpenCLModel::WorkGroup) == 1 &&
+ static_cast<unsigned>(AtomicScopeOpenCLModel::Device) == 2 &&
+ static_cast<unsigned>(AtomicScopeOpenCLModel::AllSVMDevices) == 3 &&
+ static_cast<unsigned>(AtomicScopeOpenCLModel::SubGroup) == 4,
+ "Invalid OpenCL memory scope enum definition");
Builder.defineMacro("__OPENCL_MEMORY_SCOPE_WORK_ITEM", "0");
Builder.defineMacro("__OPENCL_MEMORY_SCOPE_WORK_GROUP", "1");
Builder.defineMacro("__OPENCL_MEMORY_SCOPE_DEVICE", "2");
OpenPOWER on IntegriCloud