diff options
author | Matthias Gehre <M.Gehre@gmx.de> | 2019-07-25 17:50:51 +0000 |
---|---|---|
committer | Matthias Gehre <M.Gehre@gmx.de> | 2019-07-25 17:50:51 +0000 |
commit | 07d5b4a5da63a6e1602d04fee0eabcae3871b2f2 (patch) | |
tree | 4903a8ecbf4bd930b8d42fe96c60c68e89690004 /test/SemaOpenCL | |
parent | 297c334b449f40cdcdb42e154e0255c7fef629cf (diff) | |
download | clang-07d5b4a5da63a6e1602d04fee0eabcae3871b2f2.tar.gz |
Add lifetime categories attributes
Summary:
This is the first part of work announced in
"[RFC] Adding lifetime analysis to clang" [0],
i.e. the addition of the [[gsl::Owner(T)]] and
[[gsl::Pointer(T)]] attributes, which
will enable user-defined types to participate in
the lifetime analysis (which will be part of the
next PR).
The type `T` here is called "DerefType" in the paper,
and denotes the type that an Owner owns and a Pointer
points to. E.g. `std::vector<int>` should be annotated
with `[[gsl::Owner(int)]]` and
a `std::vector<int>::iterator` with `[[gsl::Pointer(int)]]`.
[0] http://lists.llvm.org/pipermail/cfe-dev/2018-November/060355.html
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63954
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/invalid-kernel-attrs.cl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/SemaOpenCL/invalid-kernel-attrs.cl b/test/SemaOpenCL/invalid-kernel-attrs.cl index a96e85c9ee..daa8fa07f6 100644 --- a/test/SemaOpenCL/invalid-kernel-attrs.cl +++ b/test/SemaOpenCL/invalid-kernel-attrs.cl @@ -1,12 +1,12 @@ -// RUN: %clang_cc1 -verify %s +// RUN: %clang_cc1 -verify %s kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{'vec_type_hint' attribute takes one argument}} kernel __attribute__((vec_type_hint(not_type))) void kernel2() {} //expected-error{{unknown type name 'not_type'}} -kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{invalid attribute argument 'void' - expecting a vector or vectorizable scalar type}} +kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}} -kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{invalid attribute argument 'bool' - expecting a vector or vectorizable scalar type}} +kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}} kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}} |