summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/storageclass.cl
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Restrict various keywords in OpenCL C++ modeSven van Haastregt2018-05-091-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Restrict the following keywords in the OpenCL C++ language mode, according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - register (already restricted in OpenCL C, update the diagnostic) - thread_local - exceptions (try/catch/throw) - access qualifiers read_only, write_only, read_write Support the `__global`, `__local`, `__constant`, `__private`, and `__generic` keywords in OpenCL C++. Leave the unprefixed address space qualifiers such as global available, i.e., do not mark them as reserved keywords in OpenCL C++. libclcxx provides explicit address space pointer classes such as `global_ptr` and `global<T>` that are implemented using the `__`-prefixed qualifiers. Differential Revision: https://reviews.llvm.org/D46022 llvm-svn: 331874
* [OpenCL] Add LangAS::opencl_private to represent private address space in ASTYaxun Liu2017-10-131-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | Currently Clang uses default address space (0) to represent private address space for OpenCL in AST. There are two issues with this: Multiple address spaces including private address space cannot be diagnosed. There is no mangling for default address space. For example, if private int* is emitted as i32 addrspace(5)* in IR. It is supposed to be mangled as PUAS5i but it is mangled as Pi instead. This patch attempts to represent OpenCL private address space explicitly in AST. It adds a new enum LangAS::opencl_private and adds it to the variable types which are implicitly private: automatic variables without address space qualifier function parameter pointee type without address space qualifier (OpenCL 1.2 and below) Differential Revision: https://reviews.llvm.org/D35082 llvm-svn: 315668
* [OpenCL] Diagnose scoped address-space qualified variablesAnastasia Stulova2017-06-201-0/+5
| | | | | | | | | | | | Produce an error if variables qualified with a local or a constant address space are not declared in the outermost scope of a kernel. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D34024 llvm-svn: 305798
* CodeGen: Cast alloca to expected address spaceYaxun Liu2017-05-181-17/+25
| | | | | | | | | | | Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 llvm-svn: 303370
* [OpenCL] Emit function-scope variable in constant address space as static ↵Yaxun Liu2017-05-151-1/+10
| | | | | | | | variable Differential Revision: https://reviews.llvm.org/D32977 llvm-svn: 303072
* [OpenCL] Output OpenCL version in diagnostics.Anastasia Stulova2016-05-121-1/+1
| | | | | | | | | | | | | | Diagnostics should note version dependent issues by giving a hint about current version being compiled for. This patch changes diagnostics of static storage class specifier and generic type qualifier to specify OpenCL version as well as converts other diagnostics to match the style. Patch by Vedran Miletic! Review: http://reviews.llvm.org/D19780 llvm-svn: 269305
* [OpenCL] Improve diagnostics of address spaces for variables in functionAnastasia Stulova2016-03-031-0/+3
| | | | | | | | | - Prevent local variables to be declared in global AS - Diagnose AS of local variables with an extern storage class as if they would be in a program scope Review: http://reviews.llvm.org/D17345 llvm-svn: 262641
* [OpenCL 2.0] Enable program scope variables, Section 6.5.1.Anastasia Stulova2015-09-301-6/+21
| | | | | | | | | | | | | | | | | | - Remove virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static local variables now and prevents diagnosing static local address space variables correctly. - Allow static local and global variables (OpenCL2.0 s6.8 and s6.5.1). - Improve diagnostics of allowed ASes for variables in different scopes: (i) Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1); (ii) Non-kernel function variables can't be declared in local or constant ASes (OpenCL1.1 s6.5.2 and s6.5.3). http://reviews.llvm.org/D13105 llvm-svn: 248906
* Add an error to check that all program scope variables are in the constant ↵Tanya Lattner2013-04-051-0/+2
| | | | | | address space in OpenCL. llvm-svn: 178906
* Revert 178811 until I fix the unit tests.Tanya Lattner2013-04-041-2/+0
| | | | llvm-svn: 178813
* Add an error to check that all program scope variables are in the constant ↵Tanya Lattner2013-04-041-0/+2
| | | | | | address space in OpenCL. llvm-svn: 178811
* Fix a non-conformant OpenCL test case.Joey Gouly2013-01-241-1/+1
| | | | | | | Program scope variables must be declared in the constant address space and are required to be initialized. llvm-svn: 173354
* Extend the support for cl-std to include 1.2.Tanya Lattner2012-06-191-0/+12
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. llvm-svn: 158759
OpenPOWER on IntegriCloud