summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-16 20:34:23 +0000
committerChris Lattner <sabre@nondot.org>2008-03-16 20:34:23 +0000
commit1dd77af9cedc07477d60e478809908d4cfecb955 (patch)
treef0f28d31a59c6893dc0e1ae96ea5a394988910ac /clang/lib/AST/DeclObjC.cpp
parent793ca20e2d2f1f82f887cfa8a6db6217ace05849 (diff)
downloadbcm5719-llvm-1dd77af9cedc07477d60e478809908d4cfecb955.tar.gz
bcm5719-llvm-1dd77af9cedc07477d60e478809908d4cfecb955.zip
Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.
llvm-svn: 48426
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 62336b67bdf..2ec93956449 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -54,6 +54,26 @@ ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C, SourceLocation L,
return new (Mem) ObjCProtocolDecl(L, numRefProtos, Id);
}
+ObjCClassDecl *ObjCClassDecl::Create(ASTContext &C, SourceLocation L,
+ ObjCInterfaceDecl **Elts, unsigned nElts) {
+ void *Mem = C.getAllocator().Allocate<ObjCClassDecl>();
+ return new (Mem) ObjCClassDecl(L, Elts, nElts);
+}
+
+ObjCForwardProtocolDecl *
+ObjCForwardProtocolDecl::Create(ASTContext &C, SourceLocation L,
+ ObjCProtocolDecl **Elts, unsigned NumElts) {
+ void *Mem = C.getAllocator().Allocate<ObjCForwardProtocolDecl>();
+ return new (Mem) ObjCForwardProtocolDecl(L, Elts, NumElts);
+}
+
+ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, SourceLocation L,
+ unsigned numRefProtocol,
+ IdentifierInfo *Id) {
+ void *Mem = C.getAllocator().Allocate<ObjCCategoryDecl>();
+ return new (Mem) ObjCCategoryDecl(L, numRefProtocol, Id);
+}
+
//===----------------------------------------------------------------------===//
// Objective-C Decl Implementation
OpenPOWER on IntegriCloud