aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-18 16:08:51 +0000
committerChris Lattner <sabre@nondot.org>2010-08-18 16:08:51 +0000
commit2c1ab9079cb117dc0470ab423fe0bc5177546339 (patch)
treef5e2de0a1dec09aa3883912da72e54227cabaa8d
parent7b86862ff555a9d848ac7abf6042d192b6d5a04d (diff)
no need to pass bumppointer allocator into macroinfo::destroy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111364 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Lex/MacroInfo.h7
-rw-r--r--lib/Lex/PPDirectives.cpp4
-rw-r--r--lib/Lex/Preprocessor.cpp4
3 files changed, 7 insertions, 8 deletions
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h
index 13dd40a516..009ec20f41 100644
--- a/include/clang/Lex/MacroInfo.h
+++ b/include/clang/Lex/MacroInfo.h
@@ -93,15 +93,14 @@ public:
/// FreeArgumentList - Free the argument list of the macro, restoring it to a
/// state where it can be reused for other devious purposes.
- void FreeArgumentList(llvm::BumpPtrAllocator &PPAllocator) {
- PPAllocator.Deallocate(ArgumentList);
+ void FreeArgumentList() {
ArgumentList = 0;
NumArguments = 0;
}
/// Destroy - destroy this MacroInfo object.
- void Destroy(llvm::BumpPtrAllocator &PPAllocator) {
- FreeArgumentList(PPAllocator);
+ void Destroy() {
+ FreeArgumentList();
this->~MacroInfo();
}
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index cd24533eb2..43ec3da51a 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -50,9 +50,9 @@ MacroInfo *Preprocessor::CloneMacroInfo(const MacroInfo &MacroToClone) {
/// ReleaseMacroInfo - Release the specified MacroInfo. This memory will
/// be reused for allocating new MacroInfo objects.
-void Preprocessor::ReleaseMacroInfo(MacroInfo* MI) {
+void Preprocessor::ReleaseMacroInfo(MacroInfo *MI) {
MICache.push_back(MI);
- MI->FreeArgumentList(BP);
+ MI->FreeArgumentList();
}
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 77b88f7e47..d3959aa706 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -111,7 +111,7 @@ Preprocessor::~Preprocessor() {
// 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->second->Destroy(BP);
+ I->second->Destroy();
I->first->setHasMacroDefinition(false);
}
for (std::vector<MacroInfo*>::iterator I = MICache.begin(),
@@ -120,7 +120,7 @@ Preprocessor::~Preprocessor() {
// 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);
+ (*I)->Destroy();
}
// Free any cached macro expanders.