[clang] [CIR] Upstream support for C++ member function calls (PR #140290)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Fri May 16 15:46:27 PDT 2025
================
@@ -76,11 +77,30 @@ static void appendParameterTypes(const CIRGenTypes &cgt,
cgt.getCGModule().errorNYI("appendParameterTypes: hasExtParameterInfos");
}
+/// Derives the 'this' type for CIRGen purposes, i.e. ignoring method CVR
+/// qualification. Either or both of `rd` and `md` may be null. A null `rd`
+/// indicates that there is no meaningful 'this' type, and a null `md` can occur
+/// when calling a method pointer.
+CanQualType CIRGenTypes::deriveThisType(const CXXRecordDecl *rd,
+ const CXXMethodDecl *md) {
+ QualType recTy;
+ if (rd)
+ recTy = getASTContext().getTagDeclType(rd)->getCanonicalTypeInternal();
+ else
+ recTy = getASTContext().VoidTy;
----------------
bcardosolopes wrote:
Is this path covered in the tests below? Looks like it's not but I might be missing something.
https://github.com/llvm/llvm-project/pull/140290
More information about the cfe-commits
mailing list