[PATCH] D27099: [OpenCL] Prohibit using reserve_id_t in program scope.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 25 09:41:30 PST 2016


Anastasia added inline comments.


================
Comment at: lib/Sema/SemaDecl.cpp:5924
 
-  DeclContext *OriginalDC = DC;
-  bool IsLocalExternDecl = SC == SC_Extern &&
-                           adjustContextForLocalExternDecl(DC);
+    // OpenCL 1.2 spec, p6.9 r:
+    // The event type cannot be used to declare a program scope variable.
----------------
The format is typically:
OpenCL v1.2 s6.9.r


================
Comment at: lib/Sema/SemaDecl.cpp:5926
+    // The event type cannot be used to declare a program scope variable.
+    // OpenCL v2.0 s6.9.q The clk_event_t and reserve_id_t types cannot be declared in program scope.
+    if (NULL == S->getParent()) {
----------------
This line looks inconsistent with above! Put ":" after OpenCL v2.0 s6.9.q.

Also formatting seems off. At least the line width.


https://reviews.llvm.org/D27099





More information about the cfe-commits mailing list