[PATCH] D107553: [C++4OpenCL] Initialize temporaries in the private address space

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 6 09:05:30 PDT 2021


Anastasia added inline comments.


================
Comment at: clang/include/clang/Sema/Initialization.h:341
+    QualType Type = TypeInfo->getType();
+    if (Context.getLangOpts().OpenCL && !Type.hasAddressSpace())
+      Type = Context.getAddrSpaceQualType(Type, LangAS::opencl_private);
----------------
I wonder if we should instead change the check:

`!Type.hasAddressSpace()`

into an assert?

I also wonder if it makes sense to assert that if it has an address space it should be private?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107553



More information about the cfe-commits mailing list