diff options
author | Chris Lattner <sabre@nondot.org> | 2010-08-18 16:08:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-08-18 16:08:51 +0000 |
commit | 66b67d209ecc7bf0e4f28c0df61864a0d4cf53d8 (patch) | |
tree | 3fc1c01145c8ab6b2a323606c4284b9b38222800 /clang | |
parent | c1a42fdd53afe2d837970e6a260c7b76c0a95fd9 (diff) | |
download | bcm5719-llvm-66b67d209ecc7bf0e4f28c0df61864a0d4cf53d8.tar.gz bcm5719-llvm-66b67d209ecc7bf0e4f28c0df61864a0d4cf53d8.zip |
no need to pass bumppointer allocator into macroinfo::destroy
llvm-svn: 111364
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Lex/MacroInfo.h | 7 | ||||
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/clang/include/clang/Lex/MacroInfo.h b/clang/include/clang/Lex/MacroInfo.h index 13dd40a5168..009ec20f41e 100644 --- a/clang/include/clang/Lex/MacroInfo.h +++ b/clang/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/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index cd24533eb25..43ec3da51a8 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/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/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 77b88f7e47c..d3959aa7065 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/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. |