<div dir="ltr">If the vector is the owner of the CongruenceClasses maybe making it a vector of unique_ptrs would solve the problem to the root.<div><br></div><div>Marcello</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-10 23:32 GMT-08:00 Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Dec 9, 2016 at 6:54 PM, Marcello Maggioni via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">kariddi added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/Transforms/Scalar/NewGVN.c<wbr>pp:1219<br>
+  ExpressionAllocator.Reset();<br>
+  CongruenceClasses.clear();<br>
+  ExpressionToClass.clear();<br>
----------------<br>
This gets cleared, but the CongruenceClasses seem to be created through "new" and stored in the vector.<br></blockquote><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Where do they get destroyed?<br>
<br></blockquote></span><div>This code got lost somewhere on the branch, but yes, it should be properly deleting them, not just clear'ing.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="https://reviews.llvm.org/D26224" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2622<wbr>4</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>
</blockquote></div><br></div>