[PATCH] D13105: [OpenCL] Enable program scope variables for OpenCL2.0

Anastasia via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 23 09:34:52 PDT 2015


Anastasia created this revision.
Anastasia added a reviewer: pekka.jaaskelainen.
Anastasia added a subscriber: cfe-commits.

I would like to commit this change that enables program scope variables (PSVs) – an OpenCL2.0 feature (Section 6.5.1).

There are three major changes in this patch.

First change removes virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static
local variables now and prevents diagnosing static local address space variables correctly. Also it doesn’t seem really
necessary since we can identify local AS variable by looking at the AS attribute itself.

Second change makes static local variables as well as global variables allowed in OpenCL2.0 (OpenCL2.0 s6.8 and s6.5.1).

Last change improves diagnostics of allowed ASes for variables in different scopes:

    Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1);
    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

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/Specifiers.h
  lib/AST/Decl.cpp
  lib/AST/DeclPrinter.cpp
  lib/CodeGen/CGDecl.cpp
  lib/Sema/SemaDecl.cpp
  test/Parser/opencl-storage-class.cl
  test/SemaOpenCL/storageclass.cl
  tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13105.35520.patch
Type: text/x-patch
Size: 11072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150923/5a9a0917/attachment-0001.bin>


More information about the cfe-commits mailing list