diff options
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 2ec9395644..cd4c6fff9f 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -68,10 +68,9 @@ ObjCForwardProtocolDecl::Create(ASTContext &C, SourceLocation L, } ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, SourceLocation L, - unsigned numRefProtocol, IdentifierInfo *Id) { void *Mem = C.getAllocator().Allocate<ObjCCategoryDecl>(); - return new (Mem) ObjCCategoryDecl(L, numRefProtocol, Id); + return new (Mem) ObjCCategoryDecl(L, Id); } @@ -164,6 +163,17 @@ void ObjCProtocolDecl::addMethods(ObjCMethodDecl **insMethods, AtEndLoc = endLoc; } +void ObjCCategoryDecl::setReferencedProtocolList(ObjCProtocolDecl **List, + unsigned NumRPs) { + assert(NumReferencedProtocols == 0 && "Protocol list already set"); + if (NumRPs == 0) return; + + ReferencedProtocols = new ObjCProtocolDecl*[NumRPs]; + memcpy(ReferencedProtocols, List, NumRPs*sizeof(ObjCProtocolDecl*)); + NumReferencedProtocols = NumRPs; +} + + /// addMethods - Insert instance and methods declarations into /// ObjCCategoryDecl's CatInsMethods and CatClsMethods fields. /// |