diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-02-17 20:24:53 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-02-17 20:24:53 +0000 |
commit | 8c7250b7badebbf143d6372b6b4ab8ad2867cecc (patch) | |
tree | e6ff1af46a644f2278980c366f6c21244fda6bfa /lib/AST/DeclBase.cpp | |
parent | d311f376c364e5a6c88b63b1d5c53f560ea5e650 (diff) |
Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 10 |
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 |