aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index e92796b5ba..665e927142 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -4600,13 +4600,16 @@ llvm::Constant *CGObjCNonFragileABIMac::EmitIvarList(
unsigned iv = 0;
for (RecordDecl::field_iterator e = RD->field_end(CGM.getContext());
i != e; ++i) {
+ ObjCIvarDecl *IVD = OIvars[iv++];
+ // Don't emit entries for unnamed bit fields.
+ if (!IVD->getDeclName())
+ continue;
+
FieldDecl *Field = *i;
- Ivar[0] = EmitIvarOffsetVar(ID->getClassInterface(), OIvars[iv++],
+ assert(Field == OID->lookupFieldDeclForIvar(CGM.getContext(), IVD));
+ Ivar[0] = EmitIvarOffsetVar(ID->getClassInterface(), IVD,
GetIvarBaseOffset(Layout, Field));
- if (Field->getIdentifier())
- Ivar[1] = GetMethodVarName(Field->getIdentifier());
- else
- Ivar[1] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+ Ivar[1] = GetMethodVarName(Field->getIdentifier());
Ivar[2] = GetMethodVarType(Field);
const llvm::Type *FieldTy =
CGM.getTypes().ConvertTypeForMem(Field->getType());