]> granicus.if.org Git - clang/commitdiff
Minor code clean up in method def area.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Nov 2007 17:40:57 +0000 (17:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Nov 2007 17:40:57 +0000 (17:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43980 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/Sema.h
Sema/SemaDecl.cpp
include/clang/Parse/Action.h

index 31b54106dbe2c009376eea90a50abfee7e47ef1d..2d6c42593bde2067931a1c2c0320cf1b7d6cd379 100644 (file)
@@ -190,7 +190,7 @@ private:
   virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group);
 
   virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
-  virtual DeclTy *ObjcActOnStartOfMethodDef(Scope *S, DeclTy *D);
+  virtual void ObjcActOnStartOfMethodDef(Scope *S, DeclTy *D);
   virtual DeclTy *ActOnFunctionDefBody(DeclTy *Decl, StmtTy *Body);
   virtual void ActOnMethodDefBody(DeclTy *Decl, StmtTy *Body);
   
index 65e7af53210dd646082af9b8da3d2a74cdb1ff3f..7ba743cf5ea657f1c7f4d5c00d70a40b3fe9ca3f 100644 (file)
@@ -1030,6 +1030,8 @@ void Sema::ActOnMethodDefBody(DeclTy *D, StmtTy *Body) {
   
   // Verify and clean out per-function state.
   
+  // TODO: This code block is common with ActOnFunctionDefBody and need be 
+  // refactored.
   // Check goto/label use.
   for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator
        I = LabelMap.begin(), E = LabelMap.end(); I != E; ++I) {
@@ -1053,7 +1055,7 @@ void Sema::ActOnMethodDefBody(DeclTy *D, StmtTy *Body) {
 
 /// ObjcActOnStartOfMethodDef - This routine sets up parameters; invisible
 /// and user declared, in the method definition's AST.
-Sema::DeclTy *Sema::ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
+void Sema::ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
   assert(CurFunctionDecl == 0 && "Function parsing confused");
   ObjcMethodDecl *MDecl = dyn_cast<ObjcMethodDecl>(static_cast<Decl *>(D));
   
@@ -1094,8 +1096,6 @@ Sema::DeclTy *Sema::ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
   }
 
   FD->setParams(&Params[0], Params.size());
-  
-  return FD;
 }
 
 /// ImplicitlyDefineFunction - An undeclared identifier was used in a function
index ec9d4e30dd74dcdc0a369daf625e4ea43e777cee..0166e30e7c0013a26268f7e0b981c3e6710bf1f2 100644 (file)
@@ -135,9 +135,8 @@ public:
     return ActOnDeclarator(FnBodyScope, D, 0);
   }
 
-  virtual DeclTy *ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
-    // Default to ObjcActOnMethodDefinition.
-    return ObjcActOnMethodDefinition(FnBodyScope, D, 0);
+  virtual void ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
+    return;
   }
   
   /// ActOnFunctionDefBody - This is called when a function body has completed