]> granicus.if.org Git - clang/commitdiff
Revert most of r116862. It isn't quite the right fix for a memory leak in Preprocessor.
authorTed Kremenek <kremenek@apple.com>
Tue, 19 Oct 2010 21:40:34 +0000 (21:40 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 19 Oct 2010 21:40:34 +0000 (21:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp

index 9138af064f2680d8c75be30aa52fdfdea1eb12dd..b958d9e489fb1d9a09a1b1ffa4a4462667771ceb 100644 (file)
@@ -58,11 +58,7 @@ MacroInfo *Preprocessor::CloneMacroInfo(const MacroInfo &MacroToClone) {
 ///  be reused for allocating new MacroInfo objects.
 void Preprocessor::ReleaseMacroInfo(MacroInfo *MI) {
   MICache.push_back(MI);
-  // We need to call 'Destroy' as opposed to 'FreeArgumentList' because
-  // the MICache object will get reused with a placement new.  This does
-  // not cause the underlying SmallVector to get it's memory released, so
-  // we need to call Destroy() here.
-  MI->Destroy();
+  MI->FreeArgumentList();
 }