[PATCH] Add ErrorOr<>::getOrDie() which uses report_fatal_error instead of assert.
alexfh at google.com
Thu Oct 9 12:01:48 PDT 2014
I would use it whenever I need to handle runtime error which I can't
recover from and I don't have a better way to report the error. I don't
agree that it's invisible, the name is pretty explicit in what it does. The
specific use case is handling parsing errors in clang-tidy check-specific
options. Parsing happens in the check constructor which doesn't have a
better way of reporting an error. See http://reviews.llvm.org/D5602 for the
patch where I would use this method instead of ErrorOr<>::operator*.
On 9 Oct 2014 22:29, "Reid Kleckner" <rnk at google.com> wrote:
> I don't think we should be burying invisible calls to report_fatal_error
> in libraries. Can you point at the code which wants to do this?
> On Thu, Oct 9, 2014 at 10:30 AM, Alexander Kornienko <alexfh at google.com>
>> Hi rafael,
>> This method allows writing code that consistently fails in case of
>> dereferencing an ErrorOr<> containing no value rather than crashing in
>> debug and
>> using uninitialized data in release build.
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits