[Support] Make all Errors convertible to std::error_code.
authorLang Hames <lhames@gmail.com>
Wed, 23 Mar 2016 23:57:28 +0000 (23:57 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 23 Mar 2016 23:57:28 +0000 (23:57 +0000)
commite7aad357a95be22a91d4d7d4131fb5fcf49f50ca
tree96389cfb0103da5454cd2d5d47077fe0b47f6735
parentea00b499c703bbdbf4c87573cf2fe5b46a0bf1c2
[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
llvm/include/llvm/Support/Error.h
llvm/lib/Support/CMakeLists.txt
llvm/lib/Support/Error.cpp [new file with mode: 0644]
llvm/lib/Support/ErrorHandling.cpp
llvm/unittests/Support/ErrorTest.cpp