summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-28 06:07:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-06-28 06:07:14 +0000
commit853fbea313b8be8cbfd2ac94e3e366300621aad6 (patch)
treed67b37cd1cea6d3af63c9108314fbf825003c35f /clang/lib/Sema/SemaDecl.cpp
parent17013286755b05167ce896701769c23b392fe366 (diff)
downloadbcm5719-llvm-853fbea313b8be8cbfd2ac94e3e366300621aad6.tar.gz
bcm5719-llvm-853fbea313b8be8cbfd2ac94e3e366300621aad6.zip
Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
llvm-svn: 52852
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 0b048b0a0af..df75109e562 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1463,7 +1463,7 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
}
Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
- assert(CurFunctionDecl == 0 && "Function parsing confused");
+ assert(getCurFunctionDecl() == 0 && "Function parsing confused");
assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function &&
"Not a function declarator!");
DeclaratorChunk::FunctionTypeInfo &FTI = D.getTypeObject(0).Fun;
@@ -1512,7 +1512,6 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
}
Decl *decl = static_cast<Decl*>(ActOnDeclarator(GlobalScope, D, 0));
FunctionDecl *FD = cast<FunctionDecl>(decl);
- CurFunctionDecl = FD;
PushDeclContext(FD);
// Check the validity of our function parameters
@@ -1533,11 +1532,9 @@ Sema::DeclTy *Sema::ActOnFinishFunctionBody(DeclTy *D, StmtTy *Body) {
Decl *dcl = static_cast<Decl *>(D);
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(dcl)) {
FD->setBody((Stmt*)Body);
- assert(FD == CurFunctionDecl && "Function parsing confused");
- CurFunctionDecl = 0;
+ assert(FD == getCurFunctionDecl() && "Function parsing confused");
} else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(dcl)) {
MD->setBody((Stmt*)Body);
- CurMethodDecl = 0;
}
PopDeclContext();
// Verify and clean out per-function state.
OpenPOWER on IntegriCloud