diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-20 20:41:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-20 20:41:34 +0000 |
commit | 7a21bd046fe57629ab074980cf8193f5e0c15735 (patch) | |
tree | b10518519046fdafac989bd4afdf5acb78e79175 /lib/AST/DeclObjC.cpp | |
parent | f259f0fa621d24a44a78c61ca5d61944d892cba8 (diff) |
move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index d0b8a9731a..ccf641f94d 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -175,6 +175,12 @@ ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC, return new (C) ObjCImplementationDecl(DC, L, ClassInterface, SuperDecl); } +/// Destroy - Call destructors and release memory. +void ObjCImplementationDecl::Destroy(ASTContext& C) { + IVars.clear(); +} + + ObjCCompatibleAliasDecl * ObjCCompatibleAliasDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, @@ -250,18 +256,6 @@ FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, return MemberDecl; } -/// ObjCAddInstanceVariablesToClassImpl - Checks for correctness of Instance -/// Variables (Ivars) relative to what declared in @implementation;s class. -/// Ivars into ObjCImplementationDecl's fields. -/// -void ObjCImplementationDecl::ObjCAddInstanceVariablesToClassImpl( - ObjCIvarDecl **ivars, unsigned numIvars) { - NumIvars = numIvars; - if (numIvars) { - Ivars = new ObjCIvarDecl*[numIvars]; - memcpy(Ivars, ivars, numIvars*sizeof(ObjCIvarDecl*)); - } -} // Get the local instance method declared in this interface. // FIXME: handle overloading, instance & class methods can have the same name. |