diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-16 20:34:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-16 20:34:23 +0000 |
commit | 61f9d41036e30ff80130f99b31c0626e3ef057cc (patch) | |
tree | ff0c1c447a95b18ef4eef0998ac081abb583a332 /include/clang/AST/DeclObjC.h | |
parent | 62db2f4214c1589082960f12c9cb8924fe0cf8c5 (diff) |
Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclObjC.h')
-rw-r--r-- | include/clang/AST/DeclObjC.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index ad2d571dcf..a01d62b6e0 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -523,7 +523,7 @@ public: class ObjCClassDecl : public Decl { ObjCInterfaceDecl **ForwardDecls; unsigned NumForwardDecls; -public: + ObjCClassDecl(SourceLocation L, ObjCInterfaceDecl **Elts, unsigned nElts) : Decl(ObjCClass, L) { if (nElts) { @@ -534,6 +534,10 @@ public: } NumForwardDecls = nElts; } +public: + static ObjCClassDecl *Create(ASTContext &C, SourceLocation L, + ObjCInterfaceDecl **Elts, unsigned nElts); + void setInterfaceDecl(unsigned idx, ObjCInterfaceDecl *OID) { assert(idx < NumForwardDecls && "index out of range"); ForwardDecls[idx] = OID; @@ -553,7 +557,7 @@ public: class ObjCForwardProtocolDecl : public Decl { ObjCProtocolDecl **ReferencedProtocols; unsigned NumReferencedProtocols; -public: + ObjCForwardProtocolDecl(SourceLocation L, ObjCProtocolDecl **Elts, unsigned nElts) : Decl(ObjCForwardProtocol, L) { @@ -565,6 +569,11 @@ public: ReferencedProtocols = 0; } } +public: + static ObjCForwardProtocolDecl *Create(ASTContext &C, SourceLocation L, + ObjCProtocolDecl **Elts, unsigned Num); + + void setForwardProtocolDecl(unsigned idx, ObjCProtocolDecl *OID) { assert(idx < NumReferencedProtocols && "index out of range"); ReferencedProtocols[idx] = OID; @@ -625,7 +634,7 @@ class ObjCCategoryDecl : public NamedDecl { SourceLocation EndLoc; // marks the '>' or identifier. SourceLocation AtEndLoc; // marks the end of the entire interface. -public: + ObjCCategoryDecl(SourceLocation L, unsigned numRefProtocol,IdentifierInfo *Id) : NamedDecl(ObjCCategory, L, Id), ClassInterface(0), ReferencedProtocols(0), NumReferencedProtocols(0), @@ -639,7 +648,12 @@ public: NumReferencedProtocols = numRefProtocol; } } +public: + + static ObjCCategoryDecl *Create(ASTContext &C, SourceLocation L, + unsigned numRefProtocol, IdentifierInfo *Id); + ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; } void setClassInterface(ObjCInterfaceDecl *IDecl) { ClassInterface = IDecl; } |