diff options
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index c9af67c8b6..8f9ab719b9 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -241,6 +241,9 @@ ASTContext::ASTContext(LangOptions& LOpts, SourceManager &SM, LastSDM(0, 0), UniqueBlockByRefTypeID(0) { + // Create a new allocator for partial diagnostics. + DiagAllocator = new (BumpAlloc) PartialDiagnosticStorageAllocator; + if (size_reserve > 0) Types.reserve(size_reserve); TUDecl = TranslationUnitDecl::Create(*this); @@ -285,6 +288,9 @@ ASTContext::~ASTContext() { AEnd = DeclAttrs.end(); A != AEnd; ++A) A->second->~AttrVec(); + + // Destroy the partial diagnostic allocator. + DiagAllocator->~PartialDiagnosticStorageAllocator(); } void ASTContext::AddDeallocation(void (*Callback)(void*), void *Data) { |