summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp9
-rw-r--r--llvm/lib/ProfileData/CoverageMappingReader.cpp2
2 files changed, 7 insertions, 4 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()) {
diff --git a/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp
index ce99f4d8a7b..6476d28ec35 100644
--- a/llvm/lib/ProfileData/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingReader.cpp
@@ -485,7 +485,7 @@ ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader(
}
std::error_code ObjectFileCoverageMappingReader::readHeader() {
- ObjectFile *OF = Object.getBinary().get();
+ const ObjectFile *OF = Object.getBinary();
if (!OF)
return getError();
auto BytesInAddress = OF->getBytesInAddress();
OpenPOWER on IntegriCloud