summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-07-31 17:32:12 +0000
committerTed Kremenek <kremenek@apple.com>2008-07-31 17:32:12 +0000
commite5b40a9112de2bdbb9ac3ab360f0b0a50d06752b (patch)
tree70875ceab44e8e24cbed62bb45e175af596e268d
parentb4ec8de16318307df1a54502a83a4025a6ecc7ac (diff)
downloadbcm5719-llvm-e5b40a9112de2bdbb9ac3ab360f0b0a50d06752b.tar.gz
bcm5719-llvm-e5b40a9112de2bdbb9ac3ab360f0b0a50d06752b.zip
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
llvm-svn: 54247
-rw-r--r--clang/include/clang/AST/Decl.h7
-rw-r--r--clang/include/clang/AST/DeclBase.h6
-rw-r--r--clang/include/clang/AST/DeclObjC.h4
3 files changed, 6 insertions, 11 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 0b9ac624505..cc512ce2104 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -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
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 340474cdfaa..1560aa585dd 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -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);
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 41a030d0e00..413426c6a79 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -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; }
OpenPOWER on IntegriCloud