Run destructors of MacroInfo objects to free memory they allocate. This addresses <rdar://problem/6506035>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 54c1748..5d9fc95 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -98,7 +98,9 @@
Macros.begin(), E = Macros.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.
+ // destroyed. We still need to run the dstor, however, to free
+ // memory alocated by MacroInfo.
+ I->second->~MacroInfo();
I->first->setHasMacroDefinition(false);
}