#
759b30ed |
| 30-Jun-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Fix a bug in ErrorList::join / joinErrors.
When concatenating two error lists the ErrorList::join method (which is called by joinErrors) was failing to set the checked bit on the second er
[Support] Fix a bug in ErrorList::join / joinErrors.
When concatenating two error lists the ErrorList::join method (which is called by joinErrors) was failing to set the checked bit on the second error, leading to a 'failure to check error' assertion.
llvm-svn: 274249
show more ...
|
Revision tags: llvmorg-3.8.1, llvmorg-3.8.1-rc1 |
|
#
bd8e9542 |
| 27-May-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.
Based on a totally scientific, 30 second google search "in-" appears to be the preferred prefix.
llvm-svn: 270950
|
#
c5e0bbd7 |
| 27-May-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add a StringError convenience class to Error.h
StringError can be used to represent Errors that aren't recoverable based on the error type, but that have a useful error message that can be
[Support] Add a StringError convenience class to Error.h
StringError can be used to represent Errors that aren't recoverable based on the error type, but that have a useful error message that can be reported to the user or logged.
llvm-svn: 270948
show more ...
|
#
27370a09 |
| 03-May-2016 |
Vedant Kumar <vsk@apple.com> |
[Support] Add a free toString function for Error
toString() consumes an Error and returns a string representation of its contents. This commit also adds a message() method to ErrorInfoBase for conve
[Support] Add a free toString function for Error
toString() consumes an Error and returns a string representation of its contents. This commit also adds a message() method to ErrorInfoBase for convenience.
Differential Revision: http://reviews.llvm.org/D19883
llvm-svn: 268465
show more ...
|
#
285639f8 |
| 25-Apr-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Fix latent bugs in Expected and ExitOnError that were preventing them from working with reference types.
llvm-svn: 267448
|
#
580ca237 |
| 05-Apr-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add a checked flag to Expected<T>, require checks before access or destruction.
This makes the Expected<T> class behave like Error, even when in success mode. Expected<T> values must be ch
[Support] Add a checked flag to Expected<T>, require checks before access or destruction.
This makes the Expected<T> class behave like Error, even when in success mode. Expected<T> values must be checked to see whether they contain an error prior to being dereferenced, assigned to, or destructed.
llvm-svn: 265446
show more ...
|
#
d1af8fce |
| 25-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Switch to RAII helper for error-as-out-parameter idiom.
As discussed on the llvm-commits thread for r264467.
llvm-svn: 264479
|
#
d0ac31a7 |
| 25-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add Error::errorForOutParameter helper.
This helper method creates a pre-checked Error suitable for use as an out parameter in a constructor. This avoids the need to have the constructor c
[Support] Add Error::errorForOutParameter helper.
This helper method creates a pre-checked Error suitable for use as an out parameter in a constructor. This avoids the need to have the constructor check a known-good error before assigning to it.
llvm-svn: 264467
show more ...
|
#
a15b76b3 |
| 24-Mar-2016 |
Reid Kleckner <rnk@google.com> |
Try to fix ODR violation of ErrorInfo::ID
This implements my suggestion to Lang.
llvm-svn: 264360
|
#
882f2092 |
| 24-Mar-2016 |
NAKAMURA Takumi <geek4civic@gmail.com> |
ErrorTest.cpp: Move instantiations out of anonymous namespace. gcc didn't complain.
llvm-svn: 264297
|
#
e6d29c99 |
| 24-Mar-2016 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Define ErrorInfo::ID explicitly.
llvm-svn: 264293
|
#
b2cef64b |
| 24-Mar-2016 |
NAKAMURA Takumi <geek4civic@gmail.com> |
ErrorTest.cpp: Fix an expression, possibly typo.
llvm-svn: 264290
|
#
d21a535b |
| 24-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add conversions between Expected<T> and ErrorOr<T>.
More utilities to help with std::error_code -> Error transitions.
llvm-svn: 264238
|
#
e7aad357 |
| 23-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Make all Errors convertible to std::error_code.
This is a temporary crutch to enable code that currently uses std::error_code to be incrementally moved over to Error. Requiring all Error i
[Support] Make all Errors convertible to std::error_code.
This is a temporary crutch to enable code that currently uses std::error_code to be incrementally moved over to Error. Requiring all Error instances be convertible enables clients to call errorToErrorCode on any error (not just ECErrors created by conversion *from* an error_code).
This patch also moves code for Error from ErrorHandling.cpp into a new Error.cpp file.
llvm-svn: 264221
show more ...
|
#
01864a2d |
| 18-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Refactor Error unit tests to avoid duplicating work.
Suggested by Dave Blaikie in review for r263749. Thanks Dave!
llvm-svn: 263768
|
#
6935c2d3 |
| 17-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add ExitOnError utility to support tools that use the exit-on-error idiom.
Most LLVM tool code exits immediately when an error is encountered and prints an error message to stderr. The Exi
[Support] Add ExitOnError utility to support tools that use the exit-on-error idiom.
Most LLVM tool code exits immediately when an error is encountered and prints an error message to stderr. The ExitOnError class supports this by providing two call operators - one for Errors, and one for Expected<T>s. Calls to code that can return Errors (or Expected<T>s) can use these calls to bail out on error, and otherwise continue as if the operation had succeeded. E.g.
Error foo(); Expected<int> bar();
int main(int argc, char *argv[]) { ExitOnError ExitOnErr;
ExitOnErr.setBanner(std::string("Error in ") + argv[0] + ":");
// Exit if foo returns an error. No need to manually check error return. ExitOnErr(foo());
// Exit if bar returns an error, otherwise unwrap the contained int and // continue. int X = ExitOnErr(bar());
// ...
return 0; }
llvm-svn: 263749
show more ...
|
#
01a3cf4d |
| 17-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Make Error::isA<T>() works on success values.
llvm-svn: 263745
|
#
9fb8e1b2 |
| 16-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Update Error unit test to remove implementation specific behaviour.
llvm-svn: 263610
|
#
f7f6d3e9 |
| 16-Mar-2016 |
Lang Hames <lhames@gmail.com> |
[Support] Add the 'Error' class for structured error handling.
This patch introduces the Error classs for lightweight, structured, recoverable error handling. It includes utilities for creating, man
[Support] Add the 'Error' class for structured error handling.
This patch introduces the Error classs for lightweight, structured, recoverable error handling. It includes utilities for creating, manipulating and handling errors. The scheme is similar to exceptions, in that errors are described with user-defined types. Unlike exceptions however, errors are represented as ordinary return types in the API (similar to the way std::error_code is used).
For usage notes see the LLVM programmer's manual, and the Error.h header. Usage examples can be found in unittests/Support/ErrorTest.cpp.
Many thanks to David Blaikie, Mehdi Amini, Kevin Enderby and others on the llvm-dev and llvm-commits lists for lots of discussion and review.
llvm-svn: 263609
show more ...
|