summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h2
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h20
-rw-r--r--llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h7
3 files changed, 1 insertions, 28 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
index 63790220078..e4bed95fdab 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
@@ -85,8 +85,6 @@ public:
ModuleSetHandleT H =
BaseLayer.addObjectSet(Objects, std::move(MemMgr), std::move(Resolver));
- BaseLayer.takeOwnershipOfBuffers(H, std::move(Buffers));
-
return H;
}
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
index f3094dafae3..5ba0bb21afd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
@@ -64,18 +64,9 @@ protected:
RTDyld->mapSectionAddress(LocalAddress, TargetAddr);
}
- void takeOwnershipOfBuffer(std::unique_ptr<MemoryBuffer> B) {
- OwnedBuffers.push_back(std::move(B));
- }
-
protected:
std::unique_ptr<RuntimeDyld> RTDyld;
enum { Raw, Finalizing, Finalized } State;
-
- // FIXME: This ownership hack only exists because RuntimeDyldELF still
- // wants to be able to inspect the original object when resolving
- // relocations. As soon as that can be fixed this should be removed.
- std::vector<std::unique_ptr<MemoryBuffer>> OwnedBuffers;
};
typedef std::list<std::unique_ptr<LinkedObjectSet>> LinkedObjectSetListT;
@@ -83,16 +74,6 @@ protected:
public:
/// @brief Handle to a set of loaded objects.
typedef LinkedObjectSetListT::iterator ObjSetHandleT;
-
- // Ownership hack.
- // FIXME: Remove this as soon as RuntimeDyldELF can apply relocations without
- // referencing the original object.
- template <typename OwningMBSet>
- void takeOwnershipOfBuffers(ObjSetHandleT H, OwningMBSet MBs) {
- for (auto &MB : MBs)
- (*H)->takeOwnershipOfBuffer(std::move(MB));
- }
-
};
/// @brief Default (no-op) action to perform when loading objects.
@@ -126,7 +107,6 @@ private:
RTDyld->resolveRelocations();
RTDyld->registerEHFrames();
MemMgr->finalizeMemory();
- OwnedBuffers.clear();
State = Finalized;
}
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
index 951993f75e4..42770fcdcae 100644
--- a/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
+++ b/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
@@ -175,12 +175,7 @@ public:
std::tie(Obj, Buf) = O.takeBinary();
std::vector<std::unique_ptr<object::ObjectFile>> Objs;
Objs.push_back(std::move(Obj));
- auto H =
- ObjectLayer.addObjectSet(std::move(Objs), &MemMgr, &Resolver);
-
- std::vector<std::unique_ptr<MemoryBuffer>> Bufs;
- Bufs.push_back(std::move(Buf));
- ObjectLayer.takeOwnershipOfBuffers(H, std::move(Bufs));
+ ObjectLayer.addObjectSet(std::move(Objs), &MemMgr, &Resolver);
}
void addArchive(object::OwningBinary<object::Archive> A) override {
OpenPOWER on IntegriCloud