From: Zhongxing Xu Date: Sat, 10 Jan 2009 14:14:16 +0000 (+0000) Subject: add castToDeclContext/castFromDeclContext methods to RecordDecl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e58336400c9bea6daa4e4038ec71a61bf430dd0b;p=clang add castToDeclContext/castFromDeclContext methods to RecordDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62026 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index e0b0b169a2..673669209c 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1146,7 +1146,12 @@ public: return D->getKind() >= RecordFirst && D->getKind() <= RecordLast; } static bool classof(const RecordDecl *D) { return true; } - + static DeclContext *castToDeclContext(const RecordDecl *D) { + return static_cast(const_cast(D)); + } + static RecordDecl *castFromDeclContext(const DeclContext *DC) { + return static_cast(const_cast(DC)); + } protected: /// EmitImpl - Serialize this RecordDecl. Called by Decl::Emit. virtual void EmitImpl(llvm::Serializer& S) const;