Anastasia added inline comments.

================
Comment at: clang/include/clang/AST/ASTContext.h:1366
+  /// Returns default address space based on OpenCL version and enabled 
features
+  inline LangAS getDefaultOpenCLAddrSpace() {
+    return LangOpts.OpenCLGenericAddressSpace ? LangAS::opencl_generic
----------------
We should probably rename this to `getDefaultPointeeOpenCLAddrSpace` because 
this only reflects the default address space for the pointer types.


================
Comment at: clang/lib/AST/Expr.cpp:3782
         // since it cannot be assigned to a pointer to constant address space.
-        if ((Ctx.getLangOpts().OpenCLVersion >= 200 &&
-             Pointee.getAddressSpace() == LangAS::opencl_generic) ||
-            (Ctx.getLangOpts().OpenCL &&
-             Ctx.getLangOpts().OpenCLVersion < 200 &&
-             Pointee.getAddressSpace() == LangAS::opencl_private))
+        if (Pointee.getAddressSpace() == Ctx.getDefaultOpenCLAddrSpace())
           Qs.removeAddressSpace();
----------------
Let's add `Ctx.getLangOpts().OpenCL` check at the start to make sure this only 
runs for OpenCL.


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

https://reviews.llvm.org/D109874

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to