summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2025-03-21 10:54:24 -0300
committerGitHub <noreply@github.com>2025-03-21 10:54:24 -0300
commit141656644959ea43b61868ef16e3d2782d40ea51 (patch)
treed6be138e2335bdf573b8872b2d46b4629bb30905 /clang/lib/CodeGen/CGClass.cpp
parentac9049df7e62e2ca4dc5d103593b51639b5715e3 (diff)
Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (#132317)
Relands Original PR: https://github.com/llvm/llvm-project/pull/131965 Addresses https://github.com/llvm/llvm-project/pull/131965#issuecomment-2741619498 * Fixes isIncompleteType for injected classes This clears up some uses of getClass on MemberPointerType when equivalent uses of getMostRecentCXXRecordDecl would be just as simple or simpler. This is split-off from a larger patch which removes getClass, in order to facilitate review.
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index fa69caa41936..98c93b5bb488 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -161,10 +161,9 @@ CodeGenFunction::EmitCXXMemberDataPointerAddress(const Expr *E, Address base,
QualType memberType = memberPtrType->getPointeeType();
CharUnits memberAlign =
CGM.getNaturalTypeAlignment(memberType, BaseInfo, TBAAInfo);
- memberAlign =
- CGM.getDynamicOffsetAlignment(base.getAlignment(),
- memberPtrType->getClass()->getAsCXXRecordDecl(),
- memberAlign);
+ memberAlign = CGM.getDynamicOffsetAlignment(
+ base.getAlignment(), memberPtrType->getMostRecentCXXRecordDecl(),
+ memberAlign);
return Address(ptr, ConvertTypeForMem(memberPtrType->getPointeeType()),
memberAlign);
}