Code gen. for ivar references; including bitfield
ivars.
llvm-svn: 61043
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index aa96bc5..08c9b93 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -720,8 +720,9 @@
Context.getObjCEncodingForType((*iter)->getType(), TypeStr);
IvarTypes.push_back(CGM.GetAddrOfConstantCString(TypeStr));
// Get the offset
+ FieldDecl *Field = ClassDecl->lookupFieldDeclForIvar(Context, (*iter));
int offset =
- (int)Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(*iter));
+ (int)Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));
IvarOffsets.push_back(
llvm::ConstantInt::get(llvm::Type::Int32Ty, offset));
}