[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
This commit is contained in:
Yaxun Liu
2016-05-13 15:44:37 +00:00
parent 57cdcb07d6
commit 64936ce91d
28 changed files with 277 additions and 146 deletions

View File

@@ -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) {