diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-05-16 17:06:34 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-05-16 17:06:34 +0000 |
commit | 39cf40f6b4c6deb66c3ff27f0cba73ed8b9d0cbc (patch) | |
tree | 2065265703a4521859685c00949c1a9f699a7e9d /clang/lib/Sema/Sema.cpp | |
parent | 46a256a3ebd0f03fa830ac5f26f8df3616494cf7 (diff) | |
download | bcm5719-llvm-39cf40f6b4c6deb66c3ff27f0cba73ed8b9d0cbc.tar.gz bcm5719-llvm-39cf40f6b4c6deb66c3ff27f0cba73ed8b9d0cbc.zip |
[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.
Re-commit after fixing build error due to missing override attribute.
Differential Revision: http://reviews.llvm.org/D19484
llvm-svn: 269670
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 8 |
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) { |