summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp')
-rw-r--r--gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp b/gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp
index e95115ec6fe..22f1303f433 100644
--- a/gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp
+++ b/gnu/llvm/lib/ExecutionEngine/Orc/OrcError.cpp
@@ -20,6 +20,9 @@ using namespace llvm::orc;
namespace {
+// FIXME: This class is only here to support the transition to llvm::Error. It
+// will be removed once this transition is complete. Clients should prefer to
+// deal with the Error value directly, rather than converting to error_code.
class OrcErrorCategory : public std::error_category {
public:
const char *name() const LLVM_NOEXCEPT override { return "orc"; }
@@ -38,6 +41,8 @@ public:
return "Remote indirect stubs owner Id already in use";
case OrcErrorCode::UnexpectedRPCCall:
return "Unexpected RPC call";
+ case OrcErrorCode::UnexpectedRPCResponse:
+ return "Unexpected RPC response";
}
llvm_unreachable("Unhandled error code");
}
@@ -49,9 +54,10 @@ static ManagedStatic<OrcErrorCategory> OrcErrCat;
namespace llvm {
namespace orc {
-std::error_code orcError(OrcErrorCode ErrCode) {
+Error orcError(OrcErrorCode ErrCode) {
typedef std::underlying_type<OrcErrorCode>::type UT;
- return std::error_code(static_cast<UT>(ErrCode), *OrcErrCat);
+ return errorCodeToError(
+ std::error_code(static_cast<UT>(ErrCode), *OrcErrCat));
}
}
}