[PATCH] D64569: [OpenCL] Improve destructor support in C++ for OpenCL

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 12:06:11 PDT 2019


rjmccall added a comment.

LGTM with one minor request.



================
Comment at: clang/lib/AST/DeclCXX.cpp:2267
   QualType ClassTy = C.getTypeDeclType(Decl);
-  ClassTy = C.getQualifiedType(ClassTy, FPT->getMethodQuals());
-  return C.getPointerType(ClassTy);
+  return C.getQualifiedType(ClassTy, FPT->getMethodQuals());
 }
----------------
Thanks.  Can you extract this implementation out into a `static` function (i.e. an internal linkage function in this file) that takes an `ASTContext&` so that `getThisType` doesn't have to fetch the `ASTContext` twice?


================
Comment at: clang/lib/CodeGen/CGExprCXX.cpp:99
+  assert(!ThisTy.isNull());
+  assert(!ThisTy->isPointerType() && "Unexpected pointer type");
+  assert(ThisTy->getAsCXXRecordDecl() == DtorDecl->getParent() &&
----------------
mantognini wrote:
> I wasn't 100% sure if this was covered by the next assertion.
It is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64569





More information about the cfe-commits mailing list