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 | 7b8ba815027ba92503e258d083949f05fec5cc8c (patch) | |
tree | 3ab736081eca5d6dc21e308e2a52adfac8341f27 /lib/ExecutionEngine/MCJIT | |
parent | 7dd15e65fb20b2b515b5ef8d942974b404b7e876 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 8f1662f6ee7..da5f03799e3 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/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()) { |