<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 3, 2017 at 12:06 AM Mandeep Singh Grang via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mgrang added inline comments.<br>
<br>
<br>
================<br>
Comment at: unittests/Support/ReverseIterationTest.cpp:69<br>
+<br>
+ static unsigned getHashValue(const PtrLikeInt *PtrVal) {<br>
+ return (unsigned)(PtrVal->value * 37U);<br>
----------------<br>
How about this implementation? PtrLikeInt is pointer-like but it hashes based on an integer value.<br></blockquote><div><br>Hmm, I guess that works - hadn't considered that. Would this work if the type in the container was PtrLikeInt instead of PtrLikeInt*? Seems it might be a touch simpler.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don't think this would work for SmallPtrSet (as you had pointed out). </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
================<br>
Comment at: unittests/Support/ReverseIterationTest.cpp:95<br>
+ if (shouldReverseIterate<PtrLikeInt *>())<br>
+ std::reverse(&IterKeys[0], &IterKeys[4]);<br>
+<br>
----------------<br>
@dblaikie llvm::reverse(IterKeys) does not change the existing array, right?.</blockquote><div><br>Oh, right, sure.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I found using std::reverse cleaner than using another array to hold the reversed one. What do you say?<br></blockquote><div><br>Fine as-is.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D37241" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37241</a><br>
<br>
<br>
<br>
</blockquote></div></div>