forked from OSchip/llvm-project
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
llvm-svn: 54247
This commit is contained in:
parent
b4ec8de163
commit
e5b40a9112
|
@ -433,14 +433,11 @@ public:
|
||||||
/// set that function declaration to the actual declaration
|
/// set that function declaration to the actual declaration
|
||||||
/// containing the body (if there is one).
|
/// containing the body (if there is one).
|
||||||
Stmt *getBody(const FunctionDecl *&Definition) const;
|
Stmt *getBody(const FunctionDecl *&Definition) const;
|
||||||
Stmt *getBody() const {
|
|
||||||
|
virtual Stmt *getBody() const {
|
||||||
const FunctionDecl* Definition;
|
const FunctionDecl* Definition;
|
||||||
return getBody(Definition);
|
return getBody(Definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Stmt* getCodeBody() const {
|
|
||||||
return getBody();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// isThisDeclarationADefinition - Returns whether this specific
|
/// isThisDeclarationADefinition - Returns whether this specific
|
||||||
/// declaration of the function is also a definition. This does not
|
/// declaration of the function is also a definition. This does not
|
||||||
|
|
|
@ -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
|
// such as a function or method definition, this method returns the top-level
|
||||||
// Stmt* of that body. Otherwise this method returns null.
|
// Stmt* of that body. Otherwise this method returns null.
|
||||||
virtual Stmt* getCodeBody() const { return 0; }
|
virtual Stmt* getBody() const { return 0; }
|
||||||
|
|
||||||
// global temp stats (until we have a per-module visitor)
|
// global temp stats (until we have a per-module visitor)
|
||||||
static void addDeclKind(Kind k);
|
static void addDeclKind(Kind k);
|
||||||
|
|
|
@ -228,10 +228,8 @@ public:
|
||||||
return ImplementationControl(DeclImplementation);
|
return ImplementationControl(DeclImplementation);
|
||||||
}
|
}
|
||||||
|
|
||||||
Stmt *getBody() const { return Body; }
|
virtual Stmt *getBody() const { return Body; }
|
||||||
void setBody(Stmt *B) { Body = B; }
|
void setBody(Stmt *B) { Body = B; }
|
||||||
|
|
||||||
virtual Stmt* getCodeBody() const { return getBody(); }
|
|
||||||
|
|
||||||
// Implement isa/cast/dyncast/etc.
|
// Implement isa/cast/dyncast/etc.
|
||||||
static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; }
|
static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; }
|
||||||
|
|
Loading…
Reference in New Issue