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 | 53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd (patch) | |
tree | 588340921cc284ce356556588d0916c8f422d298 /lib/Sema/SemaDeclObjC.cpp | |
parent | 0d52da1812bfc70fd7a577966104c1c9d03143f6 (diff) |
Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 5ac493140b..09f1179112 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -21,7 +21,7 @@ using namespace clang; /// ObjCActOnStartOfMethodDef - This routine sets up parameters; invisible /// and user declared, in the method definition's AST. void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) { - assert(CurMethodDecl == 0 && "Method parsing confused"); + assert(getCurMethodDecl() == 0 && "Method parsing confused"); ObjCMethodDecl *MDecl = dyn_cast<ObjCMethodDecl>(static_cast<Decl *>(D)); assert(MDecl != 0 && "Not a method declarator!"); @@ -32,7 +32,6 @@ void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) { AddFactoryMethodToGlobalPool(MDecl); // Allow all of Sema to see that we are entering a method definition. - CurMethodDecl = MDecl; PushDeclContext(MDecl); // Create Decl objects for each parameter, entrring them in the scope for @@ -53,11 +52,11 @@ void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) { } } else // we have a factory method. selfTy = Context.getObjCClassType(); - CurMethodDecl->setSelfDecl(CreateImplicitParameter(FnBodyScope, + getCurMethodDecl()->setSelfDecl(CreateImplicitParameter(FnBodyScope, PI.Ident, PI.IdentLoc, selfTy)); PI.Ident = &Context.Idents.get("_cmd"); - CurMethodDecl->setCmdDecl(CreateImplicitParameter(FnBodyScope, + getCurMethodDecl()->setCmdDecl(CreateImplicitParameter(FnBodyScope, PI.Ident, PI.IdentLoc, Context.getObjCSelType())); // Introduce all of the other parameters into this scope. @@ -1191,4 +1190,3 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, return PIDecl; } - |