[llvm] r244212 - Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.

Yaron Keren via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 06:18:59 PDT 2015


Author: yrnkrn
Date: Thu Aug  6 08:18:59 2015
New Revision: 244212

URL: http://llvm.org/viewvc/llvm-project?rev=244212&view=rev
Log:
Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.


Modified:
    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244212&r1=244211&r2=244212&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Thu Aug  6 08:18:59 2015
@@ -1099,6 +1099,14 @@ void AsmWriterEmitter::EmitPrintAliasIns
   }
 
   O << "#endif // PRINT_ALIAS_INSTR\n";
+
+  // Free allocated memory.
+  for (auto &Aliases : AliasMap)
+    for (auto &Alias : Aliases.second)
+      delete Alias.first;
+  for (auto &P : IAPrinterMap)
+    for (IAPrinter* IAP : P.second)
+      delete IAP;  
 }
 
 AsmWriterEmitter::AsmWriterEmitter(RecordKeeper &R) : Records(R), Target(R) {




More information about the llvm-commits mailing list