[PATCH] D96178: [OpenCL] Create VoidPtrTy with generic AS in C++ for OpenCL mode

Anton Zabaznov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 11:50:43 PST 2021


azabaznov marked an inline comment as done.
azabaznov added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:15289
+            ExpectedResultType->getAs<PointerType>()) {
+      ExpectedResultType = SemaRef.Context.getCanonicalType(
+          RemoveAddressSpaceFromPtr(SemaRef, ExpectedPtrTy->getTypePtr()));
----------------
Anastasia wrote:
> FYI I think `ExpectedResultType` is going to be in always in the canonical form here by the way it is constructed so `getCanonicalType` should be redundant.
> 
> 
Not sure if I understand this one, because `QualType` can't be cast to `CanQualType` so I think `getCanonicalType()` is needed. But I tried to unify existing logic and rewrote `RemoveAddressSpaceFromPtr()` to return `CanQualType` as it can be implicitly cast to `QualType`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96178



More information about the cfe-commits mailing list