aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index a8ca34dca5..bca7adc758 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -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