[cfe-commits] r111364 - in /cfe/trunk: include/clang/Lex/MacroInfo.h lib/Lex/PPDirectives.cpp lib/Lex/Preprocessor.cpp

Chris Lattner sabre at nondot.org
Wed Aug 18 09:08:51 PDT 2010


Author: lattner
Date: Wed Aug 18 11:08:51 2010
New Revision: 111364

URL: http://llvm.org/viewvc/llvm-project?rev=111364&view=rev
Log:
no need to pass bumppointer allocator into macroinfo::destroy

Modified:
    cfe/trunk/include/clang/Lex/MacroInfo.h
    cfe/trunk/lib/Lex/PPDirectives.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp

Modified: cfe/trunk/include/clang/Lex/MacroInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/MacroInfo.h?rev=111364&r1=111363&r2=111364&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/MacroInfo.h (original)
+++ cfe/trunk/include/clang/Lex/MacroInfo.h Wed Aug 18 11:08:51 2010
@@ -93,15 +93,14 @@
   
   /// 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();
   }
 

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=111364&r1=111363&r2=111364&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Aug 18 11:08:51 2010
@@ -50,9 +50,9 @@
 
 /// 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();
 }
 
 

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=111364&r1=111363&r2=111364&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Wed Aug 18 11:08:51 2010
@@ -111,7 +111,7 @@
     // 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 @@
     // 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.





More information about the cfe-commits mailing list