diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:04:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:04:31 +0000 |
commit | 67956052ea5fb0cd7f443de96a11f9a0176dc681 (patch) | |
tree | f49f5838d0e2d97976433d39fadd392e3df7dbba /lib/AST/DeclObjC.cpp | |
parent | 63359c80b0ff4bd3e898f38efe88be3c01581320 (diff) |
move the interace list of @class to use ObjCList.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 5b59af9d95..b0d36dbab8 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -115,22 +115,11 @@ void ObjCProtocolDecl::Destroy(ASTContext &C) { ObjCClassDecl *ObjCClassDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, - ObjCInterfaceDecl **Elts, unsigned nElts) { + ObjCInterfaceDecl *const *Elts, + unsigned nElts) { return new (C) ObjCClassDecl(DC, L, Elts, nElts); } -ObjCClassDecl::ObjCClassDecl(DeclContext *DC, SourceLocation L, - ObjCInterfaceDecl **Elts, unsigned nElts) - : Decl(ObjCClass, DC, L) { - if (nElts) { - ForwardDecls = new ObjCInterfaceDecl*[nElts]; - memcpy(ForwardDecls, Elts, nElts*sizeof(ObjCInterfaceDecl*)); - } else { - ForwardDecls = 0; - } - NumForwardDecls = nElts; -} - void ObjCClassDecl::Destroy(ASTContext &C) { // FIXME: There is no clear ownership policy now for referenced @@ -141,9 +130,7 @@ void ObjCClassDecl::Destroy(ASTContext &C) { // obviating this problem. Because of this situation, referenced // ObjCInterfaceDecls are destroyed in ~TranslationUnit. - delete [] ForwardDecls; - ForwardDecls = 0; - + ForwardDecls.clear(); Decl::Destroy(C); } |