[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)
commitf7f6d3e93f739077dc280532d906ca523489b01f
tree7dd9cbb4fc2e18eec6a80d040b31ac0a9bbe15d2
parent39d2411c3bc30612fa873f11301ea954d774ff4e
[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
llvm/docs/ProgrammersManual.rst
llvm/include/llvm/Support/Error.h [new file with mode: 0644]
llvm/lib/Support/ErrorHandling.cpp
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/ErrorTest.cpp [new file with mode: 0644]