[PATCH] D46022: [OpenCL] Restrict various keywords in OpenCL C++ mode

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 25 10:21:40 PDT 2018


svenvh updated this revision to Diff 143951.
svenvh edited the summary of this revision.
svenvh added a comment.

Implemented most of the restrictions as parser or Sema checks instead.  This results in nicer diagnostics too, thanks for the suggestion!

For the address space qualifiers such as global / __global / local / ..., I still think we should differentiate them in the lexer, as "global", "local" etc. are not reserved keywords in OpenCL C++.


https://reviews.llvm.org/D46022

Files:
  include/clang/Basic/DiagnosticCommonKinds.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/TokenKinds.def
  include/clang/Sema/DeclSpec.h
  lib/Basic/IdentifierTable.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Parse/ParseDecl.cpp
  lib/Parse/ParseStmtAsm.cpp
  lib/Sema/DeclSpec.cpp
  lib/Sema/SemaCast.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaStmt.cpp
  test/Parser/opencl-cl20.cl
  test/Parser/opencl-cxx-keywords.cl
  test/Parser/opencl-storage-class.cl
  test/SemaOpenCL/storageclass.cl
  test/SemaOpenCLCXX/restricted.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46022.143951.patch
Type: text/x-patch
Size: 25066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180425/56ed47e4/attachment-0001.bin>


More information about the cfe-commits mailing list