summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-10-02 00:10:42 +0000
committerSteve Naroff <snaroff@apple.com>2007-10-02 00:10:42 +0000
commitbf81db14c5333d76a3df25ac4d9a1418a19ed0ba (patch)
treec7ad04f5310b57826556a147fb6495df93358332
parent587cc428646ab3e8bbb27de5f942358b8e9005b8 (diff)
downloadbcm5719-llvm-bf81db14c5333d76a3df25ac4d9a1418a19ed0ba.tar.gz
bcm5719-llvm-bf81db14c5333d76a3df25ac4d9a1418a19ed0ba.zip
Add comment to ObjcClassDecl.
Move ObjcClassDecl to be next to ObjcForwardProtocolDecl. Since they are very similar, might want to unify their names (e.g. ObjcForwardClassDecl). Change indentation of ObjcForwardProtocolDecl to conform to everything else in DeclObjC.h. llvm-svn: 42513
-rw-r--r--clang/include/clang/AST/DeclObjC.h88
1 files changed, 46 insertions, 42 deletions
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index c17aca6543c..9deb1dc533f 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -167,28 +167,6 @@ private:
AccessControl DeclAccess : 3;
};
-class ObjcClassDecl : public TypeDecl {
- ObjcInterfaceDecl **ForwardDecls; // Null if not defined.
- int NumForwardDecls; // -1 if not defined.
-public:
- ObjcClassDecl(SourceLocation L, unsigned nElts)
- : TypeDecl(ObjcClass, L, 0, 0) {
- if (nElts) {
- ForwardDecls = new ObjcInterfaceDecl*[nElts];
- memset(ForwardDecls, '\0', nElts*sizeof(ObjcInterfaceDecl*));
- }
- NumForwardDecls = nElts;
- }
- void setInterfaceDecl(int idx, ObjcInterfaceDecl *OID) {
- assert((idx < NumForwardDecls) && "index out of range");
- ForwardDecls[idx] = OID;
- }
- static bool classof(const Decl *D) {
- return D->getKind() == ObjcClass;
- }
- static bool classof(const ObjcClassDecl *D) { return true; }
-};
-
/// ObjcMethodDecl - Represents an instance or class method declaration.
/// ObjC methods can be declared within 4 contexts: class interfaces,
/// categories, protocols, and class implementations. While C++ member
@@ -353,31 +331,57 @@ public:
static bool classof(const ObjcProtocolDecl *D) { return true; }
};
-/// ObjcForwardProtocolDecl - Represents a forward protocol declaration.
-/// For example:
+/// ObjcClassDecl - Specifies a list of forward class declarations. For example:
+///
+/// @class NSCursor, NSImage, NSPasteboard, NSWindow;
///
+class ObjcClassDecl : public TypeDecl {
+ ObjcInterfaceDecl **ForwardDecls; // Null if not defined.
+ int NumForwardDecls; // -1 if not defined.
+public:
+ ObjcClassDecl(SourceLocation L, unsigned nElts)
+ : TypeDecl(ObjcClass, L, 0, 0) {
+ if (nElts) {
+ ForwardDecls = new ObjcInterfaceDecl*[nElts];
+ memset(ForwardDecls, '\0', nElts*sizeof(ObjcInterfaceDecl*));
+ }
+ NumForwardDecls = nElts;
+ }
+ void setInterfaceDecl(int idx, ObjcInterfaceDecl *OID) {
+ assert((idx < NumForwardDecls) && "index out of range");
+ ForwardDecls[idx] = OID;
+ }
+ static bool classof(const Decl *D) {
+ return D->getKind() == ObjcClass;
+ }
+ static bool classof(const ObjcClassDecl *D) { return true; }
+};
+
+/// ObjcForwardProtocolDecl - Specifies a list of forward protocol declarations.
+/// For example:
+///
/// @protocol NSTextInput, NSChangeSpelling, NSDraggingInfo;
///
class ObjcForwardProtocolDecl : public TypeDecl {
- ObjcProtocolDecl **ForwardProtocolDecls; // Null if not defined.
- int NumForwardProtocolDecls; // -1 if not defined.
- public:
- ObjcForwardProtocolDecl(SourceLocation L, unsigned nElts)
- : TypeDecl(ObjcForwardProtocol, L, 0, 0) {
- if (nElts) {
- ForwardProtocolDecls = new ObjcProtocolDecl*[nElts];
- memset(ForwardProtocolDecls, '\0', nElts*sizeof(ObjcProtocolDecl*));
- NumForwardProtocolDecls = nElts;
- }
- }
- void setForwardProtocolDecl(int idx, ObjcProtocolDecl *OID) {
- assert((idx < NumForwardProtocolDecls) && "index out of range");
- ForwardProtocolDecls[idx] = OID;
- }
- static bool classof(const Decl *D) {
- return D->getKind() == ObjcForwardProtocol;
+ ObjcProtocolDecl **ForwardProtocolDecls; // Null if not defined.
+ int NumForwardProtocolDecls; // -1 if not defined.
+public:
+ ObjcForwardProtocolDecl(SourceLocation L, unsigned nElts)
+ : TypeDecl(ObjcForwardProtocol, L, 0, 0) {
+ if (nElts) {
+ ForwardProtocolDecls = new ObjcProtocolDecl*[nElts];
+ memset(ForwardProtocolDecls, '\0', nElts*sizeof(ObjcProtocolDecl*));
+ NumForwardProtocolDecls = nElts;
}
- static bool classof(const ObjcForwardProtocolDecl *D) { return true; }
+ }
+ void setForwardProtocolDecl(int idx, ObjcProtocolDecl *OID) {
+ assert((idx < NumForwardProtocolDecls) && "index out of range");
+ ForwardProtocolDecls[idx] = OID;
+ }
+ static bool classof(const Decl *D) {
+ return D->getKind() == ObjcForwardProtocol;
+ }
+ static bool classof(const ObjcForwardProtocolDecl *D) { return true; }
};
/// ObjcCategoryDecl - Represents a category declaration. A category allows
OpenPOWER on IntegriCloud