[cfe-commits] r120118 - /cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
Anders Carlsson
andersca at mac.com
Wed Nov 24 13:53:50 PST 2010
Author: andersca
Date: Wed Nov 24 15:53:50 2010
New Revision: 120118
URL: http://llvm.org/viewvc/llvm-project?rev=120118&view=rev
Log:
Simplify code.
Modified:
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=120118&r1=120117&r2=120118&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Wed Nov 24 15:53:50 2010
@@ -498,11 +498,9 @@
// 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);
More information about the cfe-commits
mailing list