[PATCH] D35522: Move Runtime libcall definitions to a .def file

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 10:15:44 PDT 2017


On Fri, Jul 21, 2017 at 10:10 AM Derek Schuff via Phabricator <
reviews at reviews.llvm.org> wrote:

> dschuff added a comment.
>
> Actually, maybe an even better idea:
> `getLibcallName()` returns a StringRef and asserts rather than returning a
> failure code. `getLIbcallNameIfAvailable()` returns an Expected<StringRef>
> and can fail.
>

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.


> 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.
>

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?

- Dave


>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D35522
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170721/a284f27b/attachment.html>


More information about the llvm-commits mailing list