<div dir="rtl"><div dir="ltr">Thanks, it's best to avoid dynamic memory altogether.</div><div dir="ltr"><br></div></div><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_quote">2015-08-06 22:24 GMT+03:00 David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Made some improvements to this in r244252</blockquote></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 6:18 AM, Yaron Keren via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: yrnkrn<br>
Date: Thu Aug  6 08:18:59 2015<br>
New Revision: 244212<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=244212&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=244212&view=rev</a><br>
Log:<br>
Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.<br>
<br>
<br>
Modified:<br>
    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp<br>
<br>
Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244212&r1=244211&r2=244212&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244212&r1=244211&r2=244212&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)<br>
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Thu Aug  6 08:18:59 2015<br>
@@ -1099,6 +1099,14 @@ void AsmWriterEmitter::EmitPrintAliasIns<br>
   }<br>
<br>
   O << "#endif // PRINT_ALIAS_INSTR\n";<br>
+<br>
+  // Free allocated memory.<br>
+  for (auto &Aliases : AliasMap)<br>
+    for (auto &Alias : Aliases.second)<br>
+      delete Alias.first;<br>
+  for (auto &P : IAPrinterMap)<br>
+    for (IAPrinter* IAP : P.second)<br>
+      delete IAP;<br>
 }<br>
<br>
 AsmWriterEmitter::AsmWriterEmitter(RecordKeeper &R) : Records(R), Target(R) {<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></div></div>