<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Committed as <span style="font-family: 'Helvetica Neue';" class="">r216704.</span><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Thanks,</font></div><div class=""><font face="Helvetica Neue" class="">-Chris</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font><div><blockquote type="cite" class=""><div class="">On Aug 28, 2014, at 5:16 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Sure, LGTM. I think clang-format will format the for loops differently, but I don't care.</div><div class="gmail_extra"><br class=""><br class=""><div class="gmail_quote">On Thu, Aug 28, 2014 at 5:05 PM, Chris Bieneman <span dir="ltr" class=""><<a href="mailto:beanz@apple.com" target="_blank" class="">beanz@apple.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Makes sense. How does this look?<span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""><div class="">
-Chris</div><div class=""><br class=""></div><div class=""></div></div></font></span></div>
<br class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""></div><div class=""><br class=""><div class=""><div class="">On Aug 28, 2014, at 4:48 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>> wrote:</div><br class="">
<blockquote type="cite" class=""><div dir="ltr" class=""><div class="">@@ -106,8 +104,8 @@ static void RegisterHandlers() {</div><div class=""> // If the handlers are already registered, we're done.</div><div class=""> if (NumRegisteredSignals != 0) return;</div>
<div class=""> </div><div class="">- std::for_each(IntSigs, IntSigsEnd, RegisterHandler);</div>
<div class="">- std::for_each(KillSigs, KillSigsEnd, RegisterHandler);</div><div class="">+ std::for_each(IntSigs, std::end(IntSigs), RegisterHandler);</div><div class="">+ std::for_each(KillSigs, std::end(KillSigs), RegisterHandler);</div><div class="">
<br class=""></div><div class="">Just use a range based for loop?</div><div class=""><br class=""></div><div class="">for (auto S : IntSigs) RegisterHandler(S);</div><div class=""><br class=""></div><div class="">seems cleaner than the existing code...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">
}</div><div class=""> </div><div class=""> static void UnregisterHandlers() {</div><div class="">@@ -166,7 +164,8 @@ static RETSIGTYPE SignalHandler(int Sig) {</div><div class=""> {</div><div class=""> unique_lock<SmartMutex<true>> Guard(SignalsMutex);</div>
<div class=""> RemoveFilesToRemove();</div><div class="">-</div><div class="">+ const int *const IntSigsEnd = std::end(IntSigs);</div><div class="">+ </div><div class=""> if (std::find(IntSigs, IntSigsEnd, Sig) != IntSigsEnd) {</div><div class=""><br class=""></div><div class="">
I would rewrite all of this to just use 'std::begin' and 'std::end' directly rather than the variable.</div><div class=""><br class=""></div><div class=""> if (InterruptFunction) {</div><div class=""> void (*IF)() = InterruptFunction;</div>
</div><div class="gmail_extra"><br class=""><br class=""><div class="gmail_quote">On Thu, Aug 28, 2014 at 3:31 PM, Chris Bieneman <span dir="ltr" class=""><<a href="mailto:beanz@apple.com" target="_blank" class="">beanz@apple.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch has some small code cleanup to remove static initializers from Signals.inc.<br class="">
<br class="">
Thanks,<br class="">
-Chris<br class="">
<br class="">
<br class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</blockquote></div><br class=""></div></div></div>
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>