From: Fariborz Jahanian Date: Mon, 22 Aug 2011 20:15:24 +0000 (+0000) Subject: objc - use existing API for temporary switch of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7939418cbdf1b610a69e6adf29cd7dc8d0e9eaf8;p=clang objc - use existing API for temporary switch of objc's decl context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138267 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index a5fb31afaf..46f64561af 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -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(ProtocolPtrTy); } PIDecl->makeitReadWriteAttribute();