summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-06-17 23:15:40 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-06-17 23:15:40 +0000
commit7bcce49e049411a8f793fcf6fe57639fdbce654a (patch)
tree5b70b2de08ecc6942ded1a7cab6617324fecb31e /clang/lib/Sema/SemaDeclCXX.cpp
parent89ee957cbd02ed08778b543c015fa59efe0c8b0f (diff)
downloadbcm5719-llvm-7bcce49e049411a8f793fcf6fe57639fdbce654a.tar.gz
bcm5719-llvm-7bcce49e049411a8f793fcf6fe57639fdbce654a.zip
Factor out some common code into Sema::EnterDeclaratorContext/ExitDeclaratorContext.
llvm-svn: 73655
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index bb1f50f104b..a37929cb67d 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -2852,12 +2852,7 @@ void Sema::ActOnCXXEnterDeclInitializer(Scope *S, DeclPtrTy Dcl) {
// was used in a member function of X.
// Change current context into the context of the initializing declaration.
-
- assert(PreDeclaratorDC == 0 && "Previous declarator context not popped?");
- PreDeclaratorDC = static_cast<DeclContext*>(S->getEntity());
- CurContext = D->getDeclContext();
- assert(CurContext && "No context?");
- S->setEntity(CurContext);
+ EnterDeclaratorContext(S, D->getDeclContext());
}
/// ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an
@@ -2874,12 +2869,5 @@ void Sema::ActOnCXXExitDeclInitializer(Scope *S, DeclPtrTy Dcl) {
return;
assert(S->getEntity() == D->getDeclContext() && "Context imbalance!");
- S->setEntity(PreDeclaratorDC);
- PreDeclaratorDC = 0;
-
- // Reset CurContext to the nearest enclosing context.
- while (!S->getEntity() && S->getParent())
- S = S->getParent();
- CurContext = static_cast<DeclContext*>(S->getEntity());
- assert(CurContext && "No context?");
+ ExitDeclaratorContext(S);
}
OpenPOWER on IntegriCloud