Yes, <meta charset="utf-8">SelectionDAG::~SelectionDAG() does destroy Ordering, but here it's not about the destructor, it's about the clear method, which allocates a new ordering for the DAG without destroying the previous one.<div>
<br></div><div>Nicolas<br><br><div class="gmail_quote">On Mon, Feb 15, 2010 at 11:51 PM, Evan Cheng <span dir="ltr"><<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp<br>
===================================================================<br>
--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp   (revision 96248)<br>
+++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp   (working copy)<br>
@@ -829,6 +829,7 @@<br>
   EntryNode.UseList = 0;<br>
   AllNodes.push_back(&EntryNode);<br>
   Root = getEntryNode();<br>
+  delete Ordering;<br>
   Ordering = new SDNodeOrdering();<br>
 }<br>
<br>
Thanks. But this is somewhat surprising. SelectionDAG::~SelectionDAG()  does destroy Ordering. I don't understand under what condition this would leak memory?<br>
<br>
Evan<br>
<div><div></div><div class="h5"><br>
On Feb 15, 2010, at 2:44 PM, nicolas geoffray wrote:<br>
<br>
> Dear all,<br>
><br>
> The following patch fixes a memory leak found by valgrind in SelectionDAG.cpp. I am not familiar with the codegen system, so please someone comment & apply.<br>
><br>
> Thanks!<br>
> Nicolas<br>
</div></div>> <leak.patch>_______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote></div><br></div>