diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-06-06 17:21:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-06-06 17:21:42 +0000 |
commit | 1a726d7cbf62ab13949743e9ef8c0670dd862e46 (patch) | |
tree | 869e6c2364233d197281317fcbf4b822e01cbfba /lib/AST/TranslationUnit.cpp | |
parent | 8a779314870760848e61da2c428a78971fe3f1c3 (diff) |
Because of a lack of a clear ownership role between ObjCInterfaceDecls and
ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a
horrible hack, and must be removed eventually.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TranslationUnit.cpp')
-rw-r--r-- | lib/AST/TranslationUnit.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/AST/TranslationUnit.cpp b/lib/AST/TranslationUnit.cpp index f8416f18fa..e78502f267 100644 --- a/lib/AST/TranslationUnit.cpp +++ b/lib/AST/TranslationUnit.cpp @@ -37,6 +37,20 @@ TranslationUnit::~TranslationUnit() { if (Killed.count(*I)) continue; Killed.insert(*I); + + // FIXME: This is a horrible hack. Because there is no clear ownership + // role between ObjCInterfaceDecls and the ObjCPropertyDecls that they + // reference, we need to destroy ObjCPropertyDecls here. This will + // eventually be fixed when the ownership of ObjCPropertyDecls gets + // cleaned up. + if (ObjCInterfaceDecl* IDecl = dyn_cast<ObjCInterfaceDecl>(*I)) + for (ObjCInterfaceDecl::classprop_iterator ID=IDecl->classprop_begin(), + ED=IDecl->classprop_end(); ID!=ED; ++ID) { + if (Killed.count(*ID)) continue; + Killed.insert(*ID); + (*ID)->Destroy(*Context); + } + (*I)->Destroy(*Context); } } |