summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-04-25 19:56:45 +0000
committerLang Hames <lhames@gmail.com>2016-04-25 19:56:45 +0000
commitef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063 (patch)
treeb64ecf2ee46a302e33d6348b66917baf1bec1f2d /llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
parent074ea2851c4a4c5afeba2390d905eca062d66096 (diff)
downloadbcm5719-llvm-ef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063.tar.gz
bcm5719-llvm-ef5a0ee2c3dad1c0e2fc51cf260a76d2acadf063.zip
[ORC] Thread Error/Expected through the RPC library.
This replaces use of std::error_code and ErrorOr in the ORC RPC support library with Error and Expected. This required updating the OrcRemoteTarget API, Client, and server code, as well as updating the Orc C API. This patch also fixes several instances where Errors were dropped. llvm-svn: 267457
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
index 9bf861a595b..b2680aa7d8a 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
@@ -29,7 +29,7 @@ public:
QueueChannel(Queue &InQueue, Queue &OutQueue)
: InQueue(InQueue), OutQueue(OutQueue) {}
- std::error_code readBytes(char *Dst, unsigned Size) override {
+ Error readBytes(char *Dst, unsigned Size) override {
while (Size != 0) {
// If there's nothing to read then yield.
while (InQueue.empty())
@@ -43,17 +43,17 @@ public:
InQueue.pop();
}
}
- return std::error_code();
+ return Error::success();
}
- std::error_code appendBytes(const char *Src, unsigned Size) override {
+ Error appendBytes(const char *Src, unsigned Size) override {
std::lock_guard<std::mutex> Lock(OutQueue.getLock());
while (Size--)
OutQueue.push(*Src++);
- return std::error_code();
+ return Error::success();
}
- std::error_code send() override { return std::error_code(); }
+ Error send() override { return Error::success(); }
private:
Queue &InQueue;
@@ -95,7 +95,7 @@ TEST_F(DummyRPC, TestAsyncVoidBool) {
[&](bool &B) {
EXPECT_EQ(B, true)
<< "Bool serialization broken";
- return std::error_code();
+ return Error::success();
});
EXPECT_FALSE(EC) << "Simple expect over queue failed";
}
@@ -123,7 +123,7 @@ TEST_F(DummyRPC, TestAsyncIntInt) {
{
// Expect a call to Proc1.
auto EC = expect<IntInt>(C2,
- [&](int32_t I) {
+ [&](int32_t I) -> Expected<int32_t> {
EXPECT_EQ(I, 21)
<< "Bool serialization broken";
return 2 * I;
@@ -202,7 +202,7 @@ TEST_F(DummyRPC, TestSerialization) {
<< "std::string serialization broken";
EXPECT_EQ(v, std::vector<int>({42, 7}))
<< "std::vector serialization broken";
- return std::error_code();
+ return Error::success();
});
EXPECT_FALSE(EC) << "Big (serialization test) call over queue failed";
}
OpenPOWER on IntegriCloud