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

2018-05-09 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331874: [OpenCL] Restrict various keywords in OpenCL C++ mode (authored by svenvh, committed by ). Changed prior to commit: https://reviews.llvm.org/D46022?vs=144745&id=145904#toc Repository: rC Clan

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

2018-05-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks! https://reviews.llvm.org/D46022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-05-01 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Alrght, LGTM. https://reviews.llvm.org/D46022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

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

2018-05-01 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 144745. svenvh edited the summary of this revision. svenvh added a comment. Dropped the `asm` and `goto` restrictions from this patch for now until we have clarification from Khronos. Applied the `thread_local` restrictions to OpenCL C too. https://reviews.

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

2018-04-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + svenvh wrote: > rjmccall wrote: > > svenvh wrote: > > > rjmccall wrote: > > > > svenvh wrote: > > > > > rjmccall wrote: > > > > > > You might consider parsi

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

2018-04-30 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + rjmccall wrote: > svenvh wrote: > > rjmccall wrote: > > > svenvh wrote: > > > > rjmccall wrote: > > > > > You might consider parsing the statement normally an

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

2018-04-30 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 144583. svenvh added a comment. Moved thread storage class specifier diagnosing to `ActOnVariableDeclarator`. https://reviews.llvm.org/D46022 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticParseKinds.td include/clang/

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

2018-04-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + svenvh wrote: > rjmccall wrote: > > svenvh wrote: > > > rjmccall wrote: > > > > You might consider parsing the statement normally and then just > > > > dia

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

2018-04-26 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + rjmccall wrote: > svenvh wrote: > > rjmccall wrote: > > > You might consider parsing the statement normally and then just > > > diagnosing after the fact, ma

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

2018-04-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + svenvh wrote: > rjmccall wrote: > > You might consider parsing the statement normally and then just diagnosing > > after the fact, maybe in Sema. You'd ha

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

2018-04-26 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 144138. svenvh added a comment. Reject goto in `Sema::ActOnIndirectGotoStmt` too, and add a test for indirect goto. https://reviews.llvm.org/D46022 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticParseKinds.td include

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

2018-04-26 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + rjmccall wrote: > You might consider parsing the statement normally and then just diagnosing > after the fact, maybe in Sema. You'd have to add the check in

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

2018-04-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/TokenKinds.def:255 +// KEYNOOPENCL - This is a keyword that is not supported in OpenCL C +// nor in OpenCL C++. // KEYALTIVEC - This is a keyword in AltiVec svenvh wrote: > rjm

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

2018-04-26 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: include/clang/Basic/TokenKinds.def:255 +// KEYNOOPENCL - This is a keyword that is not supported in OpenCL C +// nor in OpenCL C++. // KEYALTIVEC - This is a keyword in AltiVec rjmccall wrote: > `KE

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

2018-04-26 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 144098. svenvh edited the summary of this revision. svenvh added a comment. Updated patch to reject any thread storage class specifier, not just `thread_local`. Also mark the OpenCL access qualifiers as reserved keywords as per OpenCL C++ 1.0 s2.2, and add a

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

2018-04-25 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Yeah, if there are actually differences in the set of keywords, that's a totally reasonable thing to handle in the lexer. Comment at: include/clang/Basic/TokenKinds.def:255 +// KEYNOOPENCL - This is a keyword that is not supported in OpenCL C +//

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

2018-04-25 Thread Sven van Haastregt via Phabricator via cfe-commits
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 glob

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

2018-04-24 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I'm not sure that doing this in the lexer is appropriate; you should just diagnose the unsupported feature in Sema, or at best the parser. Repository: rC Clang https://reviews.llvm.org/D46022 ___ cfe-commits mailing lis

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

2018-04-24 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: yaxunl, bader. Herald added subscribers: cfe-commits, Anastasia. Restrict the following keywords in the OpenCL C++ language mode, according to Section 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - goto - register (already