diff options
author | Sam Bishop <sam@bishop.dhs.org> | 2008-04-03 05:35:20 +0000 |
---|---|---|
committer | Sam Bishop <sam@bishop.dhs.org> | 2008-04-03 05:35:20 +0000 |
commit | 71de20ef8bf50e83f60d4b191cc6797cf27853d3 (patch) | |
tree | ccfcba0ff01b68489914d6d78b68ec3b6fa61ec4 /lib/AST/TranslationUnit.cpp | |
parent | 7dd1cf4031a2a06be3e3c15353ff34d5ee6e8754 (diff) |
Created a destructor so that the top-level decls can be deleted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TranslationUnit.cpp')
-rw-r--r-- | lib/AST/TranslationUnit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/TranslationUnit.cpp b/lib/AST/TranslationUnit.cpp index fdc37a8443..8211db1b74 100644 --- a/lib/AST/TranslationUnit.cpp +++ b/lib/AST/TranslationUnit.cpp @@ -30,6 +30,11 @@ enum { BasicMetadataBlock = 1, ASTContextBlock = 2, DeclsBlock = 3 }; +TranslationUnit::~TranslationUnit() +{ + for (iterator I=begin(), E=end(); I!=E; ++I) + delete *I; +} bool clang::EmitASTBitcodeFile(const TranslationUnit& TU, const llvm::sys::Path& Filename) { |