summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index d8d10b637ec..35e303ee923 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -207,8 +207,14 @@ void Sema::Initialize() {
addImplicitTypedef("size_t", Context.getSizeType());
}
- // Initialize predefined OpenCL types.
+ // Initialize predefined OpenCL types and supported optional core features.
if (getLangOpts().OpenCL) {
+#define OPENCLEXT(Ext) \
+ if (Context.getTargetInfo().getSupportedOpenCLOpts().is_##Ext##_supported_core( \
+ getLangOpts().OpenCLVersion)) \
+ getOpenCLOptions().Ext = 1;
+#include "clang/Basic/OpenCLExtensions.def"
+
addImplicitTypedef("sampler_t", Context.OCLSamplerTy);
addImplicitTypedef("event_t", Context.OCLEventTy);
if (getLangOpts().OpenCLVersion >= 200) {
OpenPOWER on IntegriCloud