[cfe-commits] r54247 - in /cfe/trunk/include/clang/AST: Decl.h DeclBase.h DeclObjC.h

Ted Kremenek kremenek at apple.com
Thu Jul 31 10:32:13 PDT 2008


Author: kremenek
Date: Thu Jul 31 12:32:12 2008
New Revision: 54247

URL: http://llvm.org/viewvc/llvm-project?rev=54247&view=rev
Log:
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/AST/DeclBase.h
    cfe/trunk/include/clang/AST/DeclObjC.h

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=54247&r1=54246&r2=54247&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Thu Jul 31 12:32:12 2008
@@ -433,14 +433,11 @@
   /// set that function declaration to the actual declaration
   /// containing the body (if there is one).
   Stmt *getBody(const FunctionDecl *&Definition) const;
-  Stmt *getBody() const { 
+
+  virtual Stmt *getBody() const { 
     const FunctionDecl* Definition;
     return getBody(Definition);
   }
-
-  virtual Stmt* getCodeBody() const {
-    return getBody();
-  }
   
   /// isThisDeclarationADefinition - Returns whether this specific
   /// declaration of the function is also a definition. This does not

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=54247&r1=54246&r2=54247&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Thu Jul 31 12:32:12 2008
@@ -198,10 +198,10 @@
     }
   }
   
-  // getCodeBody - If this Decl represents a declaration for a body of code,
+  // getBody - If this Decl represents a declaration for a body of code,
   //  such as a function or method definition, this method returns the top-level
-  //  Stmt* of that body.  Otherwise this method returns null.
-  virtual Stmt* getCodeBody() const { return 0; }
+  //  Stmt* of that body.  Otherwise this method returns null.  
+  virtual Stmt* getBody() const { return 0; }
   
   // global temp stats (until we have a per-module visitor)
   static void addDeclKind(Kind k);

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=54247&r1=54246&r2=54247&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Jul 31 12:32:12 2008
@@ -228,10 +228,8 @@
     return ImplementationControl(DeclImplementation); 
   }
 
-  Stmt *getBody() const { return Body; }
+  virtual Stmt *getBody() const { return Body; }
   void setBody(Stmt *B) { Body = B; }
-  
-  virtual Stmt* getCodeBody() const { return getBody(); }
 
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; }





More information about the cfe-commits mailing list