diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-06-06 16:45:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-06-06 16:45:15 +0000 |
commit | 8a779314870760848e61da2c428a78971fe3f1c3 (patch) | |
tree | 3fdaf0b48da0422a9c3b99a1b2d247325e397293 /lib/Parse/ParseObjc.cpp | |
parent | 77e1dfcffe9ed0078b015418182784b56532998c (diff) |
Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts. There are a few cases where it is not
clear what to do (FIXMEs included in the patch).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 17450747e0..baf2667a54 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -224,7 +224,7 @@ Parser::DeclTy *Parser::ParseObjCAtInterfaceDeclaration( /// void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, tok::ObjCKeywordKind contextKey) { - llvm::SmallVector<DeclTy*, 32> allMethods; + llvm::SmallVector<DeclTy*, 32> allMethods; llvm::SmallVector<DeclTy*, 16> allProperties; tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword; SourceLocation AtEndLoc; @@ -314,8 +314,11 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, } } /// Insert collected methods declarations into the @interface object. - Actions.ActOnAtEnd(AtEndLoc, interfaceDecl, &allMethods[0], allMethods.size(), - &allProperties[0], allProperties.size()); + Actions.ActOnAtEnd(AtEndLoc, interfaceDecl, + allMethods.empty() ? 0 : &allMethods[0], + allMethods.size(), + allProperties.empty() ? 0 : &allProperties[0], + allProperties.size()); } /// Parse property attribute declarations. |