diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-10-26 20:50:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-10-26 20:50:24 +0000 |
commit | 7780d2d52bda7f2bd9ecfa23d534d28817e98ba4 (patch) | |
tree | c1552b64cf802a06b449471ae1d62ca51c5e7eda /Sema/SemaDecl.cpp | |
parent | 73af669633e13c813f80cd15ecf3e6414778aee4 (diff) |
This patch allows synthesis generation of ivar offset for legacy objective-c @implementation
decl without an @interface decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Sema/SemaDecl.cpp')
-rw-r--r-- | Sema/SemaDecl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index db10de2a44..b2845978bf 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1237,6 +1237,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation( IDecl = new ObjcInterfaceDecl(SourceLocation(), 0, ClassName); IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>()); ClassName->setFETokenInfo(IDecl); + IDecl->setSuperClass(SDecl); // Remember that this needs to be removed when the scope is popped. TUScope->AddDecl(IDecl); @@ -1256,10 +1257,16 @@ void Sema::CheckImplementationIvars(ObjcImplementationDecl *ImpDecl, ObjcIvarDecl **ivars, unsigned numIvars) { assert(ImpDecl && "missing implementation decl"); ObjcInterfaceDecl* IDecl = getObjCInterfaceDecl(ImpDecl->getIdentifier()); - /// 2nd check is added to accomodate case of non-existing @interface decl. + if (!IDecl) + return; + /// Check case of non-existing @interface decl. /// (legacy objective-c @implementation decl without an @interface decl). - if (!IDecl || IDecl->ImplicitInterfaceDecl()) + /// Add implementations's ivar to the synthesize class's ivar list. + if (IDecl->ImplicitInterfaceDecl()) { + IDecl->ObjcAddInstanceVariablesToClass(ivars, numIvars); return; + } + assert(ivars && "missing @implementation ivars"); // Check interface's Ivar list against those in the implementation. |