Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.

llvm-svn: 64805
This commit is contained in:
Argyrios Kyrtzidis 2009-02-17 20:24:53 +00:00
parent 4b4f67ac0a
commit 50c0ff1f43
1 changed files with 2 additions and 8 deletions

View File

@ -269,17 +269,11 @@ bool DeclContext::classof(const Decl *D) {
}
const DeclContext *DeclContext::getParent() const {
if (const Decl *D = dyn_cast<Decl>(this))
return D->getDeclContext();
return NULL;
return cast<Decl>(this)->getDeclContext();
}
const DeclContext *DeclContext::getLexicalParent() const {
if (const Decl *D = dyn_cast<Decl>(this))
return D->getLexicalDeclContext();
return getParent();
return cast<Decl>(this)->getLexicalDeclContext();
}
// FIXME: We really want to use a DenseSet here to eliminate the