forked from OSchip/llvm-project
Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.
llvm-svn: 64805
This commit is contained in:
parent
4b4f67ac0a
commit
50c0ff1f43
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue