<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 21, 2017 at 10:10 AM Derek Schuff 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">dschuff added a comment.<br>
<br>
Actually, maybe an even better idea:<br>
`getLibcallName()` returns a StringRef and asserts rather than returning a failure code. `getLIbcallNameIfAvailable()` returns an Expected<StringRef> and can fail.<br></blockquote><div><br>Probably still Optional<StringRef>, I would imagine - it doesn't have quite the 'security' of Expected<StringRef>, but there's not likely any Error that really needs to/can be communicated here, merely the absence of a result.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The former matches  90% of the existing uses. This would let us move away from char* for the external symbol APIs (assuming that's a good thing) but most of the existing uses wouldn't need to actually change, and those that check failure would still be simple.<br></blockquote><div><br>Why do so many users effectively assert on the name? There's a particular condition/context that they call it on that means they'll never be calling it on one of these libcalls that doesn't have a name?<br><br>- Dave<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/D35522" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35522</a><br>
<br>
<br>
<br>
</blockquote></div></div>