summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-20 20:41:34 +0000
committerChris Lattner <sabre@nondot.org>2009-02-20 20:41:34 +0000
commitd7ba858314967a096a57e55f9c6864a595f01682 (patch)
tree891cf1d8cd667de9d4bc4335de32f9c023848dcc /clang/lib/AST/DeclObjC.cpp
parent23433396448fd26cd67f3e900a37558409cfec85 (diff)
downloadbcm5719-llvm-d7ba858314967a096a57e55f9c6864a595f01682.tar.gz
bcm5719-llvm-d7ba858314967a096a57e55f9c6864a595f01682.zip
move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things. llvm-svn: 65150
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index d0b8a9731a3..ccf641f94d4 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud