<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 10, 2018 at 8:47 AM Alexander Richardson 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">arichardson added inline comments.<br>
<br>
<br>
================<br>
Comment at: include/llvm/ADT/STLExtras.h:208<br>
 private:<br>
-  FuncTy F;<br>
+  Optional<FuncTy> F;<br>
 };<br>
----------------<br>
Will using Optional here make lld slower with D45166 and a Release+Assertions build?<br>
Can the compiler optimize away all the Optional assertions? Maybe using `[F](ItTy It) { llvm_unreachable("end() derefeneced"); return F(It); }` is easier to optimize?<br></blockquote><div><br>That would be a different functor type, making the end iterator a different type from the begin iterator, right? I don't think that would work?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D45490" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45490</a><br>
<br>
<br>
<br>
</blockquote></div></div>