no need to pass bumppointer allocator into macroinfo::destroy
llvm-svn: 111364
This commit is contained in:
parent
c1a42fdd53
commit
66b67d209e
|
@ -93,15 +93,14 @@ public:
|
||||||
|
|
||||||
/// FreeArgumentList - Free the argument list of the macro, restoring it to a
|
/// FreeArgumentList - Free the argument list of the macro, restoring it to a
|
||||||
/// state where it can be reused for other devious purposes.
|
/// state where it can be reused for other devious purposes.
|
||||||
void FreeArgumentList(llvm::BumpPtrAllocator &PPAllocator) {
|
void FreeArgumentList() {
|
||||||
PPAllocator.Deallocate(ArgumentList);
|
|
||||||
ArgumentList = 0;
|
ArgumentList = 0;
|
||||||
NumArguments = 0;
|
NumArguments = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy - destroy this MacroInfo object.
|
/// Destroy - destroy this MacroInfo object.
|
||||||
void Destroy(llvm::BumpPtrAllocator &PPAllocator) {
|
void Destroy() {
|
||||||
FreeArgumentList(PPAllocator);
|
FreeArgumentList();
|
||||||
this->~MacroInfo();
|
this->~MacroInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ MacroInfo *Preprocessor::CloneMacroInfo(const MacroInfo &MacroToClone) {
|
||||||
|
|
||||||
/// ReleaseMacroInfo - Release the specified MacroInfo. This memory will
|
/// ReleaseMacroInfo - Release the specified MacroInfo. This memory will
|
||||||
/// be reused for allocating new MacroInfo objects.
|
/// be reused for allocating new MacroInfo objects.
|
||||||
void Preprocessor::ReleaseMacroInfo(MacroInfo* MI) {
|
void Preprocessor::ReleaseMacroInfo(MacroInfo *MI) {
|
||||||
MICache.push_back(MI);
|
MICache.push_back(MI);
|
||||||
MI->FreeArgumentList(BP);
|
MI->FreeArgumentList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ Preprocessor::~Preprocessor() {
|
||||||
// will be released when the BumpPtrAllocator 'BP' object gets
|
// will be released when the BumpPtrAllocator 'BP' object gets
|
||||||
// destroyed. We still need to run the dtor, however, to free
|
// destroyed. We still need to run the dtor, however, to free
|
||||||
// memory alocated by MacroInfo.
|
// memory alocated by MacroInfo.
|
||||||
I->second->Destroy(BP);
|
I->second->Destroy();
|
||||||
I->first->setHasMacroDefinition(false);
|
I->first->setHasMacroDefinition(false);
|
||||||
}
|
}
|
||||||
for (std::vector<MacroInfo*>::iterator I = MICache.begin(),
|
for (std::vector<MacroInfo*>::iterator I = MICache.begin(),
|
||||||
|
@ -120,7 +120,7 @@ Preprocessor::~Preprocessor() {
|
||||||
// will be released when the BumpPtrAllocator 'BP' object gets
|
// will be released when the BumpPtrAllocator 'BP' object gets
|
||||||
// destroyed. We still need to run the dtor, however, to free
|
// destroyed. We still need to run the dtor, however, to free
|
||||||
// memory alocated by MacroInfo.
|
// memory alocated by MacroInfo.
|
||||||
(*I)->Destroy(BP);
|
(*I)->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free any cached macro expanders.
|
// Free any cached macro expanders.
|
||||||
|
|
Loading…
Reference in New Issue