diff options
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index ce6d9ab..51f7293 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -87,7 +87,7 @@ Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts, (Ident__VA_ARGS__ = getIdentifierInfo("__VA_ARGS__"))->setIsPoisoned(); // Initialize the pragma handlers. - PragmaHandlers = new PragmaNamespace(0); + PragmaHandlers = new PragmaNamespace(llvm::StringRef()); RegisterBuiltinPragmas(); // Initialize builtin macros like __LINE__ and friends. @@ -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) |