]> granicus.if.org Git - clang/commit
[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args
authorEgor Churaev <egor.churaev@gmail.com>
Fri, 31 Mar 2017 10:14:52 +0000 (10:14 +0000)
committerEgor Churaev <egor.churaev@gmail.com>
Fri, 31 Mar 2017 10:14:52 +0000 (10:14 +0000)
commit1c1154229a41b688f97cdab91dfd38c28960ba55
treeef60d4029bf3369e041741be17288a476db293ea
parentdd30a590c23f0c9a73fcbdf2911ef0701cc70157
[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args

Summary:
"kernel_arg_type_qual" metadata should contain const/volatile/restrict
tags only for pointer types to match the corresponding requirement of
the OpenCL specification.

OpenCL 2.0 spec 5.9.3 Kernel Object Queries:

CL_KERNEL_ARG_TYPE_VOLATILE is returned if the argument is a pointer
and the referenced type is declared with the volatile qualifier.
[...]
Similarly, CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a
pointer and the referenced type is declared with the restrict or const
qualifier.
[...]
CL_KERNEL_ARG_TYPE_RESTRICT will be returned if the pointer type is
marked restrict.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D31321

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299192 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenFunction.cpp
test/CodeGenOpenCL/kernel-arg-info.cl