diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-02-17 17:00:07 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-02-17 17:00:07 +0000 |
commit | 3a21cd92f425680fcbfbab9552c0787b09ae9ca7 (patch) | |
tree | 93de994564aa9c3c05b81a82bb155f9be28de032 /lib/Sema/SemaDeclObjC.cpp | |
parent | 2e2a400383c7a64a927f61eeed596b08928e1d4b (diff) |
Allow for declaration and use of ivars in a stand-alone
implementation (toward radar 7547942).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 1e9b56a90e..465c4a9ee1 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -823,6 +823,12 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl, if (IDecl->isImplicitInterfaceDecl()) { IDecl->setIVarList(ivars, numIvars, Context); IDecl->setLocEnd(RBrace); + // Add ivar's to class's DeclContext. + for (unsigned i = 0, e = numIvars; i != e; ++i) { + ivars[i]->setLexicalDeclContext(IDecl); + IDecl->addDecl(ivars[i]); + } + return; } // If implementation has empty ivar list, just return. |