diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-31 01:09:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-31 01:09:11 +0000 |
commit | 198bcb44b6271c92fd856403f34b518828100aac (patch) | |
tree | d56190a685030b67dd428e3fc6024e8d3841d4e9 /lib/CodeGen/CGObjCMac.cpp | |
parent | 490fc902710eca4e4a07b2ecaa223e70670331d6 (diff) |
IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGenTypes, to per-record CGRecordLayout structures.
- I did a cursory check that this was perf neutral, FWIW.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 1ed41d005f..883ed98511 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -13,6 +13,7 @@ #include "CGObjCRuntime.h" +#include "CGRecordLayout.h" #include "CodeGenModule.h" #include "CodeGenFunction.h" #include "clang/AST/ASTContext.h" @@ -3134,8 +3135,10 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, FieldDecl *Field = RecFields[i]; uint64_t FieldOffset; if (RD) { + const CGRecordLayout &RL = + CGM.getTypes().getCGRecordLayout(Field->getParent()); if (Field->isBitField()) { - CodeGenTypes::BitFieldInfo Info = CGM.getTypes().getBitFieldInfo(Field); + const CGRecordLayout::BitFieldInfo &Info = RL.getBitFieldInfo(Field); const llvm::Type *Ty = CGM.getTypes().ConvertTypeForMemRecursive(Field->getType()); @@ -3144,7 +3147,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, FieldOffset = Info.FieldNo * TypeSize; } else FieldOffset = - Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field)); + Layout->getElementOffset(RL.getLLVMFieldNo(Field)); } else FieldOffset = ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(Field)); |