From 50c0ff1f436584fa2fd87ba21636a1ab6b0ec42c Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 17 Feb 2009 20:24:53 +0000 Subject: Currently all DeclContexts are Decls as well; use cast instead of dyn_cast. llvm-svn: 64805 --- clang/lib/AST/DeclBase.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'clang/lib/AST/DeclBase.cpp') diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index a8ca34dca54..bca7adc758e 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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(this)) - return D->getDeclContext(); - - return NULL; + return cast(this)->getDeclContext(); } const DeclContext *DeclContext::getLexicalParent() const { - if (const Decl *D = dyn_cast(this)) - return D->getLexicalDeclContext(); - - return getParent(); + return cast(this)->getLexicalDeclContext(); } // FIXME: We really want to use a DenseSet here to eliminate the -- cgit v1.2.3