summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
index d24aafed9b0..ae408a06f84 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
@@ -24,8 +24,7 @@ public:
using ObjHandleT = uint64_t;
- using ObjectPtr =
- std::shared_ptr<object::OwningBinary<object::ObjectFile>>;
+ using ObjectPtr = std::unique_ptr<MemoryBuffer>;
using LookupFn = std::function<JITSymbol(StringRef, bool)>;
using SymbolLookupTable = std::map<ObjHandleT, LookupFn>;
@@ -43,7 +42,7 @@ public:
Expected<ObjHandleT> addObject(ObjectPtr Obj,
std::shared_ptr<JITSymbolResolver> Resolver) {
- return AddObject(Obj, SymTab);
+ return AddObject(std::move(Obj), SymTab);
}
Error removeObject(ObjHandleT H) {
@@ -102,8 +101,7 @@ MockObjectLayer::ObjectPtr createTestObject() {
B.CreateRet(ConstantInt::getSigned(Type::getInt32Ty(Ctx), 42));
SimpleCompiler IRCompiler(*TM);
- return std::make_shared<object::OwningBinary<object::ObjectFile>>(
- IRCompiler(*MB.getModule()));
+ return IRCompiler(*MB.getModule());
}
TEST(RemoteObjectLayer, AddObject) {
@@ -121,7 +119,7 @@ TEST(RemoteObjectLayer, AddObject) {
// Copy the bytes out of the test object: the copy will be used to verify
// that the original is correctly transmitted over RPC to the mock layer.
- StringRef ObjBytes = TestObject->getBinary()->getData();
+ StringRef ObjBytes = TestObject->getBuffer();
std::vector<char> ObjContents(ObjBytes.size());
std::copy(ObjBytes.begin(), ObjBytes.end(), ObjContents.begin());
@@ -134,7 +132,7 @@ TEST(RemoteObjectLayer, AddObject) {
MockObjectLayer::SymbolLookupTable &SymTab) {
// Check that the received object file content matches the original.
- StringRef RPCObjContents = Obj->getBinary()->getData();
+ StringRef RPCObjContents = Obj->getBuffer();
EXPECT_EQ(RPCObjContents.size(), ObjContents.size())
<< "RPC'd object file has incorrect size";
EXPECT_TRUE(std::equal(RPCObjContents.begin(), RPCObjContents.end(),
OpenPOWER on IntegriCloud