[cfe-commits] r61939 - /cfe/trunk/include/clang/AST/DeclObjC.h
Steve Naroff
snaroff at apple.com
Thu Jan 8 12:35:59 PST 2009
Author: snaroff
Date: Thu Jan 8 14:35:58 2009
New Revision: 61939
URL: http://llvm.org/viewvc/llvm-project?rev=61939&view=rev
Log:
Add missing castToDeclContext/castFromDeclContext hooks.
Modified:
cfe/trunk/include/clang/AST/DeclObjC.h
Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=61939&r1=61938&r2=61939&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Jan 8 14:35:58 2009
@@ -758,6 +758,12 @@
static bool classof(const Decl *D) { return D->getKind() == ObjCProtocol; }
static bool classof(const ObjCProtocolDecl *D) { return true; }
+ static DeclContext *castToDeclContext(const ObjCProtocolDecl *D) {
+ return static_cast<DeclContext *>(const_cast<ObjCProtocolDecl*>(D));
+ }
+ static ObjCProtocolDecl *castFromDeclContext(const DeclContext *DC) {
+ return static_cast<ObjCProtocolDecl *>(const_cast<DeclContext*>(DC));
+ }
};
/// ObjCClassDecl - Specifies a list of forward class declarations. For example:
@@ -947,6 +953,12 @@
static bool classof(const Decl *D) { return D->getKind() == ObjCCategory; }
static bool classof(const ObjCCategoryDecl *D) { return true; }
+ static DeclContext *castToDeclContext(const ObjCCategoryDecl *D) {
+ return static_cast<DeclContext *>(const_cast<ObjCCategoryDecl*>(D));
+ }
+ static ObjCCategoryDecl *castFromDeclContext(const DeclContext *DC) {
+ return static_cast<ObjCCategoryDecl *>(const_cast<DeclContext*>(DC));
+ }
};
/// ObjCCategoryImplDecl - An object of this class encapsulates a category
@@ -1041,6 +1053,12 @@
static bool classof(const Decl *D) { return D->getKind() == ObjCCategoryImpl;}
static bool classof(const ObjCCategoryImplDecl *D) { return true; }
+ static DeclContext *castToDeclContext(const ObjCCategoryImplDecl *D) {
+ return static_cast<DeclContext *>(const_cast<ObjCCategoryImplDecl*>(D));
+ }
+ static ObjCCategoryImplDecl *castFromDeclContext(const DeclContext *DC) {
+ return static_cast<ObjCCategoryImplDecl *>(const_cast<DeclContext*>(DC));
+ }
};
/// ObjCImplementationDecl - Represents a class definition - this is where
@@ -1163,6 +1181,12 @@
return D->getKind() == ObjCImplementation;
}
static bool classof(const ObjCImplementationDecl *D) { return true; }
+ static DeclContext *castToDeclContext(const ObjCImplementationDecl *D) {
+ return static_cast<DeclContext *>(const_cast<ObjCImplementationDecl*>(D));
+ }
+ static ObjCImplementationDecl *castFromDeclContext(const DeclContext *DC) {
+ return static_cast<ObjCImplementationDecl *>(const_cast<DeclContext*>(DC));
+ }
};
/// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
More information about the cfe-commits
mailing list