Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/Sema.cpp
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | if (getLangOpts().MSVCCompat) { | ||||
if (getLangOpts().CPlusPlus && | if (getLangOpts().CPlusPlus && | ||||
IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end()) | IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end()) | ||||
PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class), | PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class), | ||||
TUScope); | TUScope); | ||||
addImplicitTypedef("size_t", Context.getSizeType()); | addImplicitTypedef("size_t", Context.getSizeType()); | ||||
} | } | ||||
if (getLangOpts().SYCLIsDevice) { | |||||
addImplicitTypedef("__ocl_event_t", Context.OCLEventTy); | |||||
addImplicitTypedef("__ocl_sampler_t", Context.OCLSamplerTy); | |||||
#ifdef SEMA_STRINGIZE | |||||
#error "Undefine SEMA_STRINGIZE macro." | |||||
#endif | |||||
#define SEMA_STRINGIZE(s) #s | |||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | |||||
addImplicitTypedef(SEMA_STRINGIZE(__ocl_##ImgType##_##Suffix##_t), \ | |||||
Context.SingletonId); | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
#undef SEMA_STRINGIZE | |||||
} | |||||
if (getLangOpts().SYCLIsDevice || getLangOpts().OpenCL) { | |||||
#ifdef SEMA_STRINGIZE | |||||
#error "Undefine SEMA_STRINGIZE macro." | |||||
#endif | |||||
#define SEMA_STRINGIZE(s) #s | |||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | |||||
addImplicitTypedef(SEMA_STRINGIZE(__ocl_sampled_##ImgType##_##Suffix##_t), \ | |||||
Context.Sampled##SingletonId); | |||||
#define IMAGE_WRITE_TYPE(Type, Id, Ext) | |||||
#define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
#undef SEMA_STRINGIZE | |||||
} | |||||
// Initialize predefined OpenCL types and supported extensions and (optional) | // Initialize predefined OpenCL types and supported extensions and (optional) | ||||
// core features. | // core features. | ||||
if (getLangOpts().OpenCL) { | if (getLangOpts().OpenCL) { | ||||
getOpenCLOptions().addSupport( | getOpenCLOptions().addSupport( | ||||
Context.getTargetInfo().getSupportedOpenCLOpts(), getLangOpts()); | Context.getTargetInfo().getSupportedOpenCLOpts(), getLangOpts()); | ||||
addImplicitTypedef("sampler_t", Context.OCLSamplerTy); | addImplicitTypedef("sampler_t", Context.OCLSamplerTy); | ||||
addImplicitTypedef("event_t", Context.OCLEventTy); | addImplicitTypedef("event_t", Context.OCLEventTy); | ||||
if (getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) { | if (getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) { | ||||
▲ Show 20 Lines • Show All 2,222 Lines • Show Last 20 Lines |