aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-11-24 21:53:50 +0000
committerAnders Carlsson <andersca@mac.com>2010-11-24 21:53:50 +0000
commit8a9dc4fcde8583b0c4389d5a43b88820adbd3022 (patch)
tree3e2d42b1379cae982e6f45001e6e7c66c55dd6b0
parentcb690b111f698f0e16e59ed82ab6a7d660edb6d1 (diff)
Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120118 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/ItaniumCXXABI.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp
index 839e0476d4..99575dfc8f 100644
--- a/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/lib/CodeGen/ItaniumCXXABI.cpp
@@ -498,11 +498,9 @@ llvm::Constant *ItaniumCXXABI::EmitMemberPointer(const FieldDecl *FD) {
// A pointer to data member is an offset from the base address of
// the class object containing it, represented as a ptrdiff_t
- QualType ClassType = getContext().getTypeDeclType(FD->getParent());
- const llvm::StructType *ClassLTy =
- cast<llvm::StructType>(CGM.getTypes().ConvertType(ClassType));
-
const CGRecordLayout &RL = CGM.getTypes().getCGRecordLayout(FD->getParent());
+ const llvm::StructType *ClassLTy = RL.getLLVMType();
+
unsigned FieldNo = RL.getLLVMFieldNo(FD);
uint64_t Offset =
CGM.getTargetData().getStructLayout(ClassLTy)->getElementOffset(FieldNo);