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 | 9ee23b7f1a4dec2d7c36a5a2f9f5cb1f6581a5d2 (patch) | |
tree | d169f20637df59f9b14ccbb7588d7b325a6b0c68 /clang/lib/AST/DeclObjC.cpp | |
parent | 17b2f5d72877e64cd009ab57182732f3f01173f9 (diff) | |
download | bcm5719-llvm-9ee23b7f1a4dec2d7c36a5a2f9f5cb1f6581a5d2.tar.gz bcm5719-llvm-9ee23b7f1a4dec2d7c36a5a2f9f5cb1f6581a5d2.zip |
move the interace list of @class to use ObjCList.
llvm-svn: 65129
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 5b59af9d953..b0d36dbab8d 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/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); } |