aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2016-05-13 15:44:37 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2016-05-13 15:44:37 +0000
commit64936ce91dba4fe91655629ce1a25895f2af6f51 (patch)
tree193e74b8eb9cbefed8552d6d4ba102e062e737b0 /clang/lib/Sema/Sema.cpp
parent57cdcb07d69cddb702ca4a428eb5c6bdb2fa0a88 (diff)
downloadllvm-64936ce91dba4fe91655629ce1a25895f2af6f51.zip
llvm-64936ce91dba4fe91655629ce1a25895f2af6f51.tar.gz
llvm-64936ce91dba4fe91655629ce1a25895f2af6f51.tar.bz2
[OpenCL] Add supported OpenCL extensions to target info.
Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
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 d8d10b6..35e303e 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) {