[PATCH] D56066: [OpenCL] Address space for default class members

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 31 12:49:08 PST 2018


rjmccall added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:78
+    RecTy = Context.getAddrSpaceQualType(
+        RecTy, MD->getTypeQualifiers().getAddressSpace());
   return Context.getPointerType(CanQualType::CreateUnsafe(RecTy));
----------------
Would you mind making a patch to rename this (and the method on `FunctionProtoType`) to something like `getMethodQualifiers`?  It can be a follow-up instead of blocking this.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:12649
+    ArgType = Context.getAddrSpaceQualType(ClassType, LangAS::opencl_generic);
+  ArgType = Context.getRValueReferenceType(ClassType);
 
----------------
You're implicitly dropping the address space qualifier here by going back to `ClassType`.


================
Comment at: lib/Sema/SemaInit.cpp:4539
+  if (InitCategory.isPRValue() || InitCategory.isXValue())
+    T1Quals.removeAddressSpace();
+
----------------
I can understand why a pr-value wouldn't have an address space, but an x-value's address space is surely important.


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

https://reviews.llvm.org/D56066





More information about the cfe-commits mailing list