[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user