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 {
|
const DeclContext *DeclContext::getParent() const {
|
||||||
if (const Decl *D = dyn_cast<Decl>(this))
|
return cast<Decl>(this)->getDeclContext();
|
||||||
return D->getDeclContext();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DeclContext *DeclContext::getLexicalParent() const {
|
const DeclContext *DeclContext::getLexicalParent() const {
|
||||||
if (const Decl *D = dyn_cast<Decl>(this))
|
return cast<Decl>(this)->getLexicalDeclContext();
|
||||||
return D->getLexicalDeclContext();
|
|
||||||
|
|
||||||
return getParent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: We really want to use a DenseSet here to eliminate the
|
// FIXME: We really want to use a DenseSet here to eliminate the
|
||||||
|
|
Loading…
Reference in New Issue