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.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 013b0f9cc3..201f53e34d 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2373,12 +2373,15 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
RecordDecl *RD = RecordDecl::Create(Ctx, TagDecl::TK_struct, 0,
SourceLocation(),
&Ctx.Idents.get("_objc_super"));
- FieldDecl *FieldDecls[2];
- FieldDecls[0] = FieldDecl::Create(Ctx, SourceLocation(), 0,
- Ctx.getObjCIdType());
- FieldDecls[1] = FieldDecl::Create(Ctx, SourceLocation(), 0,
- Ctx.getObjCClassType());
- RD->defineBody(Ctx, FieldDecls, 2);
+ RD->addDecl(Ctx,
+ FieldDecl::Create(Ctx, RD, SourceLocation(), 0,
+ Ctx.getObjCIdType(), 0, false, 0),
+ true);
+ RD->addDecl(Ctx,
+ FieldDecl::Create(Ctx, RD, SourceLocation(), 0,
+ Ctx.getObjCClassType(), 0, false, 0),
+ true);
+ RD->completeDefinition(Ctx);
SuperCTy = Ctx.getTagDeclType(RD);
SuperPtrCTy = Ctx.getPointerType(SuperCTy);