[Error] Make llvm::cantFail include the original error messages
authorDon Hinton <hintonda@gmail.com>
Thu, 17 Oct 2019 21:54:15 +0000 (21:54 +0000)
committerDon Hinton <hintonda@gmail.com>
Thu, 17 Oct 2019 21:54:15 +0000 (21:54 +0000)
commitecb310b3a7cf60d2bc28aaf8caf8fd29b9f11ec9
tree5d56586a677362a3a03aa5cac342911126abe542
parentbefab66a2c8f0b73736e68b6400675fa9593ee23
[Error] Make llvm::cantFail include the original error messages

Summary:
The current implementation eats the current errors and just outputs
the message parameter passed to llvm::cantFail.  This change appends
the original error message(s), so the user can see exactly why
cantFail failed.  New logic is conditional on NDEBUG.

Reviewed By: lhames

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69057

llvm-svn: 375176
llvm/include/llvm/Support/Error.h
llvm/unittests/Support/ErrorTest.cpp