diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-15 20:35:07 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-15 20:35:07 +0000 |
commit | fd64bb635dc221baa19f81d5d2a084f7eb269f7f (patch) | |
tree | cc7de8b7ad8802f40468ace0b831c274ca97109e /lib/CodeGen/CGObjCMac.cpp | |
parent | 0ea76727ae91bca918a8414ed85b530eddcfedeb (diff) |
Code gen. for ivar references; including bitfield
ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61043 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 201f53e34d..33dfff1030 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1328,9 +1328,12 @@ llvm::Constant *CGObjCMac::EmitIvarList(const ObjCImplementationDecl *ID, for (ObjCInterfaceDecl::ivar_iterator i = ID->getClassInterface()->ivar_begin(), e = ID->getClassInterface()->ivar_end(); i != e; ++i) { - ObjCIvarDecl *V = *i; + const ObjCIvarDecl *V = *i; + ObjCInterfaceDecl *OID = + const_cast<ObjCInterfaceDecl *>(ID->getClassInterface()); + FieldDecl *Field = OID->lookupFieldDeclForIvar(CGM.getContext(), V); unsigned Offset = - Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(V)); + Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field)); std::string TypeStr; Ivar[0] = GetMethodVarName(V->getIdentifier()); CGM.getContext().getObjCEncodingForType(V->getType(), TypeStr, true); |