]> granicus.if.org Git - clang/commitdiff
objc - use existing API for temporary switch of
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 22 Aug 2011 20:15:24 +0000 (20:15 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 22 Aug 2011 20:15:24 +0000 (20:15 +0000)
objc's decl context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp

index a5fb31afafc66597fbabfa104f9c5d5ed3fa8166..46f64561af5798574693f70067df3e47b443ad86 100644 (file)
@@ -235,8 +235,8 @@ Sema::HandlePropertyInClassExtension(Scope *S,
                             PIkind);
       // Must re-establish the context from class extension to primary
       // class context.
-      ActOnObjCContainerFinishDefinition(CDecl);
-      ActOnObjCContainerStartDefinition(CCPrimary);
+      ContextRAII SavedContext(*this, CCPrimary);
+      
       Decl *ProtocolPtrTy =
         ActOnProperty(S, AtLoc, FD, ProtocolPropertyODS,
                       PIDecl->getGetterName(),
@@ -244,9 +244,6 @@ Sema::HandlePropertyInClassExtension(Scope *S,
                       isOverridingProperty,
                       MethodImplKind,
                       /* lexicalDC = */ CDecl);
-      // restore class extension context.
-      ActOnObjCContainerFinishDefinition(CCPrimary);
-      ActOnObjCContainerStartDefinition(CDecl);
       PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy);
     }
     PIDecl->makeitReadWriteAttribute();