diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/ItaniumCXXABI.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 839e0476d40..99575dfc8f5 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/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); |

