diff options
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/AST/Type.h | 14 | ||||
| -rw-r--r-- | clang/include/clang/Basic/Builtins.def | 6 | ||||
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 14 |
3 files changed, 34 insertions, 0 deletions
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index fa87287336a..511bbc47156 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -1898,6 +1898,11 @@ public: /// This should never be used when type qualifiers are meaningful. const Type *getArrayElementTypeNoTypeQual() const; + /// If this is a pointer type, return the pointee type. + /// If this is an array type, return the array element type. + /// This should never be used when type qualifiers are meaningful. + const Type *getPointeeOrArrayElementType() const; + /// If this is a pointer, ObjC object pointer, or block /// pointer, this returns the respective pointee. QualType getPointeeType() const; @@ -5771,6 +5776,15 @@ inline const Type *Type::getBaseElementTypeUnsafe() const { return type; } +inline const Type *Type::getPointeeOrArrayElementType() const { + const Type *type = this; + if (type->isAnyPointerType()) + return type->getPointeeType().getTypePtr(); + else if (type->isArrayType()) + return type->getBaseElementTypeUnsafe(); + return type; +} + /// Insertion operator for diagnostics. This allows sending QualType's into a /// diagnostic with <<. inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def index 0f88211ffa4..96bb359e51c 100644 --- a/clang/include/clang/Basic/Builtins.def +++ b/clang/include/clang/Basic/Builtins.def @@ -1306,6 +1306,12 @@ LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC20_LANG) LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC20_LANG) LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC20_LANG) +// OpenCL v2.0 s6.13.17 - Enqueue kernel functions. +// Custom builtin check allows to perform special check of passed block arguments. +LANGBUILTIN(enqueue_kernel, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(get_kernel_work_group_size, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "i.", "tn", OCLC20_LANG) + // OpenCL v2.0 s6.13.9 - Address space qualifier functions. LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG) LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 762c7c4db16..5ca7c397a60 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -7944,6 +7944,20 @@ def err_opencl_builtin_to_addr_arg_num : Error< "invalid number of arguments to function: %0">; def err_opencl_builtin_to_addr_invalid_arg : Error< "invalid argument %0 to function: %1, expecting a generic pointer argument">; + +// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. +def err_opencl_enqueue_kernel_incorrect_args : Error< + "illegal call to enqueue_kernel, incorrect argument types">; +def err_opencl_enqueue_kernel_expected_type : Error< + "illegal call to enqueue_kernel, expected %0 argument type">; +def err_opencl_enqueue_kernel_local_size_args : Error< + "mismatch in number of block parameters and local size arguments passed">; +def err_opencl_enqueue_kernel_invalid_local_size_type : Error< + "local memory sizes need to be specified as uint">; +def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error< + "blocks used in device side enqueue are expected to have parameters of type 'local void*'">; +def err_opencl_enqueue_kernel_blocks_no_args : Error< + "blocks in this form of device side enqueue call are expected to have have no parameters">; } // end of sema category let CategoryName = "OpenMP Issue" in { |

