summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/invalid-block.cl
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Pretty print __private addr spaceAnastasia Stulova2019-12-271-6/+6
| | | | | | | | | | Add printing of __private address space to TypePrinter to allow it appears in diagnostics and AST dumps as all other language addr spaces. Tags: #clang Differential Revision: https://reviews.llvm.org/D71272
* [OpenCL] Move addr space deduction to Sema.Anastasia Stulova2019-11-271-2/+2
| | | | | | | | | | | | | | | | In order to simplify implementation we are moving add space deduction into Sema while constructing variable declaration and on template instantiation. Pointee are deduced to generic addr space during creation of types. This commit also - fixed addr space dedution for auto type; - factors out in a separate helper function OpenCL specific logic from type diagnostics in var decl. Tags: #clang Differential Revision: https://reviews.llvm.org/D65744
* [OpenCL] Handle taking an address of block captures.Anastasia Stulova2017-09-071-0/+11
| | | | | | | | | | | | | | | | Block captures can have different physical locations in memory segments depending on the use case (as a function call or as a kernel enqueue) and in different vendor implementations. Therefore it's unclear how to add address space to capture addresses uniformly. Currently it has been decided to disallow taking addresses of captured variables until further clarifications in the spec. Differential Revision: https://reviews.llvm.org/D36410 llvm-svn: 312728
* [OpenCL] Disallow blocks capture other blocks (v2.0, s6.12.5)Anastasia Stulova2017-02-161-0/+15
| | | | llvm-svn: 295307
* [OpenCL] Add missing address spaces in IR generation of blocksAnastasia Stulova2017-01-271-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | Modify ObjC blocks impl wrt address spaces as follows: - keep default private address space for blocks generated as local variables (with captures); - add global address space for global block literals (no captures); - make the block invoke function and enqueue_kernel prototype with the generic AS block pointer parameter to accommodate both private and global AS cases from above; - add block handling into default AS because it's implemented as a special pointer type (BlockPointer) in the frontend and therefore it is used as a pointer everywhere. This is also needed to accommodate both private and global AS blocks for the two cases above. - removes ObjC RT specific symbols (NSConcreteStackBlock and NSConcreteGlobalBlock) in the OpenCL mode. Review: https://reviews.llvm.org/D28814 llvm-svn: 293286
* [OpenCL] Diagnose variadic argumentsAnastasia Stulova2016-10-281-10/+17
| | | | | | | | | | | | | | OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0) apart from some exceptions: - printf - enqueue_kernel This change adds error diagnostic for variadic functions but accepts printf and any compiler internal function (which should cover __enqueue_kernel_XXX cases). It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks. llvm-svn: 285395
* [OpenCL] Improved diagnostics of OpenCL types.Anastasia Stulova2016-07-111-14/+18
| | | | | | | | | | | | | | - Changes diagnostics for Blocks to be implicitly const qualified OpenCL v2.0 s6.12.5. - Added and unified diagnostics of some OpenCL special types: blocks, images, samplers, pipes. These types are intended for use with the OpenCL builtin functions only and, therefore, most regular uses are not allowed including assignments, arithmetic operations, pointer dereferencing, etc. Review: http://reviews.llvm.org/D21989 llvm-svn: 275061
* Block: Fix a crash when we have type attributes or qualifiers with omittedManman Ren2016-04-181-9/+8
| | | | | | | | | | | | return type. Emit a warning instead of crashing in IR generation. rdar://22762981 Differential Revision: http://reviews.llvm.org/D18567 llvm-svn: 266648
* [OpenCL] Apply missing restrictions for Blocks in OpenCL v2.0Anastasia Stulova2016-03-031-12/+42
| | | | | | | | | | | | | | Applying the following restrictions for block types in OpenCL (v2.0 s6.12.5): - __block storage class is disallowed - every block declaration must be const qualified and initialized - a block can't be used as a return type of a function - a blocks can't be used to declare a structure or union field - extern speficier is disallowed Corrected image and sampler types diagnostics with struct and unions. Review: http://reviews.llvm.org/D16928 llvm-svn: 262616
* [OpenCL] Add Sema checks for OpenCL 2.0 blockXiuli Pan2016-02-241-0/+20
Summary: Add Sema checks for opencl 2.0 new features: Block. This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17436 llvm-svn: 261719
OpenPOWER on IntegriCloud