[PATCH] D64569: [OpenCL] Improve destructor support in C++ for OpenCL
Marco Antognini via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 01:56:14 PDT 2019
mantognini added inline comments.
================
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());
}
----------------
rjmccall wrote:
> 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?
Sure, no problem.
================
Comment at: clang/lib/CodeGen/CGExprCXX.cpp:99
+ assert(!ThisTy.isNull());
+ assert(!ThisTy->isPointerType() && "Unexpected pointer type");
+ assert(ThisTy->getAsCXXRecordDecl() == DtorDecl->getParent() &&
----------------
rjmccall wrote:
> mantognini wrote:
> > I wasn't 100% sure if this was covered by the next assertion.
> It is.
Alright, thanks for the clarification. I've removed it as it doesn't bring anything.
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