diff options
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index ce6d9ab5c05..c20ecef47bd 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -113,6 +113,14 @@ Preprocessor::~Preprocessor() { I->second->Destroy(BP); I->first->setHasMacroDefinition(false); } + for (std::vector<MacroInfo*>::iterator I = MICache.begin(), + E = MICache.end(); I != E; ++I) { + // We don't need to free the MacroInfo objects directly. These + // will be released when the BumpPtrAllocator 'BP' object gets + // destroyed. We still need to run the dtor, however, to free + // memory alocated by MacroInfo. + (*I)->Destroy(BP); + } // Free any cached macro expanders. for (unsigned i = 0, e = NumCachedTokenLexers; i != e; ++i) |