diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-28 06:07:14 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-28 06:07:14 +0000 |
commit | 853fbea313b8be8cbfd2ac94e3e366300621aad6 (patch) | |
tree | d67b37cd1cea6d3af63c9108314fbf825003c35f /clang/lib/Sema/SemaDecl.cpp | |
parent | 17013286755b05167ce896701769c23b392fe366 (diff) | |
download | bcm5719-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.cpp | 7 |
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. |