forked from OSchip/llvm-project
Created a destructor so that the top-level decls can be deleted.
llvm-svn: 49142
This commit is contained in:
parent
5981404289
commit
2289459bf6
|
@ -42,6 +42,8 @@ public:
|
|||
explicit TranslationUnit(const LangOptions& lopt)
|
||||
: LangOpts(lopt), Context(NULL) {}
|
||||
|
||||
~TranslationUnit();
|
||||
|
||||
void setContext(ASTContext* context) { Context = context; }
|
||||
ASTContext* getContext() const { return Context; }
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue