diff options
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index ef3b2d74fb9..a1011b830e1 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -52,13 +52,11 @@ void ObjCMethodDecl::Destroy(ASTContext& C) { ObjCInterfaceDecl *ObjCInterfaceDecl::Create(ASTContext &C, SourceLocation atLoc, - unsigned numRefProtos, IdentifierInfo *Id, SourceLocation ClassLoc, bool ForwardDecl, bool isInternal){ void *Mem = C.getAllocator().Allocate<ObjCInterfaceDecl>(); - return new (Mem) ObjCInterfaceDecl(atLoc, numRefProtos, - Id, ClassLoc, ForwardDecl, + return new (Mem) ObjCInterfaceDecl(atLoc, Id, ClassLoc, ForwardDecl, isInternal); } @@ -282,6 +280,18 @@ ObjCIvarDecl * return 0; } +/// addReferencedProtocols - Set the list of protocols that this interface +/// implements. +void ObjCInterfaceDecl::addReferencedProtocols(ObjCProtocolDecl **OID, + unsigned numRefProtos) { + assert(NumReferencedProtocols == 0 && "refproto already set!"); + NumReferencedProtocols = numRefProtos; + if (numRefProtos) { + ReferencedProtocols = new ObjCProtocolDecl*[numRefProtos]; + memcpy(ReferencedProtocols, OID, numRefProtos*sizeof(ObjCProtocolDecl*)); + } +} + /// ObjCAddInstanceVariablesToClass - Inserts instance variables /// into ObjCInterfaceDecl's fields. /// |