<div class="gmail_quote">2009/12/17 Rafael Espindola <span dir="ltr"><<a href="mailto:espindola@google.com">espindola@google.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

> OK for trunk?<br>
<br>
Actually, I think the attached patch is better. It catches more cases<br>
and is simpler.<br></blockquote><div><br>Great catch!<br><br>Could you please write a unit test for this? It took me a while to figure out what was wrong with the original code (even when it was obvious your patch was correct). The case is:<br>

  addGarbage(A);<br>  addGarbage(B);<br>  addGarbage(A);  // not caught as already in set...<br>  removeGarbage(A);  // ...unless this were remove(X) where X != A<br>though that would have to be a death test which only works in an asserts build. See unittests/ADT/APIntTest.cpp for an example of a death test in LLVM.<br>

<br>Nick<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5"><br>
Cheers,<br>
--<br>
Rafael Ávila de Espíndola<br>
</div></div><br>_______________________________________________<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>