[PATCH] D97052: [OpenCL] Prevent adding extension pragma by default

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 19 09:24:08 PST 2021


svenvh added inline comments.


================
Comment at: clang/include/clang/Basic/OpenCLExtensions.def:24
+//            its behavior explicitly is deprecated. Therefore the default
+//            value if false.
 //   avail - minimum OpenCL version supporting it.
----------------
typo


================
Comment at: clang/include/clang/Basic/OpenCLExtensions.def:65
+OPENCL_COREFEATURE(cl_khr_global_int32_extended_atomics, true, 100, OCL_C_11P)
+OPENCL_COREFEATURE(cl_khr_local_int32_base_atomics, true, 100,  OCL_C_11P)
+OPENCL_COREFEATURE(cl_khr_local_int32_extended_atomics, true, 100, OCL_C_11P)
----------------
You're introducing a double space.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:785
+      // Therefore, it should never be added by default.
+      Opt.acceptsPragma(Name);
     }
----------------
I fail to understand why this is needed, so perhaps this needs a bit more explanation.  Extensions that should continue to support pragmas already have their `WithPragma` field set to `true` via `OpenCLExtensions.def`.  Why do we need to dynamically modify the field?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97052/new/

https://reviews.llvm.org/D97052



More information about the cfe-commits mailing list