OSDN Git Service

[Support] Add the 'Error' class for structured error handling.
authorLang Hames <lhames@gmail.com>
Wed, 16 Mar 2016 01:02:46 +0000 (01:02 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 16 Mar 2016 01:02:46 +0000 (01:02 +0000)
commitb92213233cf24fef60e003de9324cbe36064138e
tree885b57cd32eed046ad59ac9d702709fd0e41b4e2
parenta235a96895220cfd984c9d49c6309007b60116d7
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263609 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ProgrammersManual.rst
include/llvm/Support/Error.h [new file with mode: 0644]
lib/Support/ErrorHandling.cpp
unittests/Support/CMakeLists.txt
unittests/Support/ErrorTest.cpp [new file with mode: 0644]