diff options
author | Lang Hames <lhames@gmail.com> | 2014-10-31 21:37:49 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2014-10-31 21:37:49 +0000 |
commit | f04de6ec48881aaa88004e7ddb36beb352339ef2 (patch) | |
tree | a2c5d8f5eefb9a09fc8e9dee82ea7270e1a7ecd5 /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | |
parent | fca26da4460130992daaa8adfe4f74aed0c75815 (diff) | |
download | bcm5719-llvm-f04de6ec48881aaa88004e7ddb36beb352339ef2.tar.gz bcm5719-llvm-f04de6ec48881aaa88004e7ddb36beb352339ef2.zip |
[Object] Modify OwningBinary's interface to separate inspection from ownership.
The getBinary and getBuffer method now return ordinary pointers of appropriate
const-ness. Ownership is transferred by calling takeBinary(), which returns a
pair of the Binary and a MemoryBuffer.
llvm-svn: 221003
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 8f1662f6ee7..da5f03799e3 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -109,8 +109,11 @@ void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) { } void MCJIT::addObjectFile(object::OwningBinary<object::ObjectFile> Obj) { - addObjectFile(std::move(Obj.getBinary())); - Buffers.push_back(std::move(Obj.getBuffer())); + std::unique_ptr<object::ObjectFile> ObjFile; + std::unique_ptr<MemoryBuffer> MemBuf; + std::tie(ObjFile, MemBuf) = Obj.takeBinary(); + addObjectFile(std::move(ObjFile)); + Buffers.push_back(std::move(MemBuf)); } void MCJIT::addArchive(object::OwningBinary<object::Archive> A) { @@ -290,7 +293,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name, return Addr; for (object::OwningBinary<object::Archive> &OB : Archives) { - object::Archive *A = OB.getBinary().get(); + object::Archive *A = OB.getBinary(); // Look for our symbols in each Archive object::Archive::child_iterator ChildIt = A->findSym(Name); if (ChildIt != A->child_end()) { |