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 e0b0b16..6736692 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -1146,7 +1146,12 @@
     return D->getKind() >= RecordFirst && D->getKind() <= RecordLast;
   }
   static bool classof(const RecordDecl *D) { return true; }
-
+  static DeclContext *castToDeclContext(const RecordDecl *D) {
+    return static_cast<DeclContext *>(const_cast<RecordDecl*>(D));
+  }
+  static RecordDecl *castFromDeclContext(const DeclContext *DC) {
+    return static_cast<RecordDecl *>(const_cast<DeclContext*>(DC));
+  }
 protected:
   /// EmitImpl - Serialize this RecordDecl.  Called by Decl::Emit.
   virtual void EmitImpl(llvm::Serializer& S) const;