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
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
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
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.
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
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
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/
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
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
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
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
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
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
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
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
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
+//
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
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
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
19 matches
Mail list logo