]> granicus.if.org Git - clang/commitdiff
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
authorTed Kremenek <kremenek@apple.com>
Thu, 31 Jul 2008 17:32:12 +0000 (17:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 31 Jul 2008 17:32:12 +0000 (17:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54247 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
include/clang/AST/DeclBase.h
include/clang/AST/DeclObjC.h

index 0b9ac624505a50545ea92aa9765253229e44e88f..cc512ce2104fa2955b42fcdaa33cc7fe6152e0f3 100644 (file)
@@ -433,14 +433,11 @@ public:
   /// 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
index 340474cdfaa4fe2d1bc3f47cf199cea22c633f9d..1560aa585dda68e8002d5f6871511cd3d98c49af 100644 (file)
@@ -198,10 +198,10 @@ public:
     }
   }
   
-  // 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);
index 41a030d0e008f00b7dcae67681299a0790859662..413426c6a79110acd30c16be362316fc9cb948cd 100644 (file)
@@ -228,10 +228,8 @@ public:
     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; }