aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-15 19:56:42 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-15 19:56:42 +0000
commit0ea76727ae91bca918a8414ed85b530eddcfedeb (patch)
tree7a572aa8d11e2f4c95caabe869f41c5b0ca44b13 /lib/Lex/Preprocessor.cpp
parent55f7bcbda37964d3c0e8928d0e50a6e1692b7dce (diff)
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
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp6
1 files changed, 3 insertions, 3 deletions
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<IdentifierInfo*, MacroInfo*>::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);
}