[PATCH] D43152: [DWARFv5] Turn an assert into a diagnostic.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 10:22:52 PST 2018


Yeah, thanks for explaining - does seem like a ErrorOr<unsigned> could be
better - and a StringError should make that easy enough to do, I think.

On Mon, Feb 12, 2018 at 8:06 AM Paul Robinson via Phabricator <
reviews at reviews.llvm.org> wrote:

> probinson added a comment.
>
> In https://reviews.llvm.org/D43152#1004647, @dblaikie wrote:
>
> > Not sure what you mean by "a non-syscall diagnostic"? (there's
> StringError if you want to just put a string rather than an error code)
>
>
> I mean, a case where a std::error_code is not what we want.
>
> > What is it that's undesirable about the error handling you've
> implemented here? Given that there's a similar error path nearby, that
> seems like a reasonable (or at least consistent) approach... but I've not
> looked at this area of the code in detail to see if there's something
> particularly undesirable about it.
>
> Overloading two return values to indicate an error, instead of a more
> explicit indication.  And then relying on callers to remember to check for
> them, instead of forcing callers to check for them.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D43152
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180212/1dce9ba3/attachment.html>


More information about the llvm-commits mailing list