From 0ea76727ae91bca918a8414ed85b530eddcfedeb Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 15 Dec 2008 19:56:42 +0000 Subject: Preprocessor: Allocate MacroInfo objects using a BumpPtrAllocator instead using new/delete. This speeds up -Eonly on Cocoa.h using the regular lexer by 1.8% and the PTHLexer by 3%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61042 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/Preprocessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Lex/Preprocessor.cpp') diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 00d3d56e2e..3fa76fa161 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -95,9 +95,9 @@ Preprocessor::~Preprocessor() { // Free any macro definitions. for (llvm::DenseMap::iterator I = Macros.begin(), E = Macros.end(); I != E; ++I) { - // Free the macro definition. - delete I->second; - I->second = 0; + // We don't need to free the MacroInfo objects directly. These + // will be released when the BumpPtrAllocator 'BP' object gets + // destroyed. I->first->setHasMacroDefinition(false); } -- cgit v1.2.3