diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-cov/TestingSupport.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp | 6 | ||||
-rw-r--r-- | llvm/tools/llvm-symbolizer/LLVMSymbolize.h | 9 |
3 files changed, 10 insertions, 7 deletions
diff --git a/llvm/tools/llvm-cov/TestingSupport.cpp b/llvm/tools/llvm-cov/TestingSupport.cpp index aa07a79e78d..537f133c647 100644 --- a/llvm/tools/llvm-cov/TestingSupport.cpp +++ b/llvm/tools/llvm-cov/TestingSupport.cpp @@ -41,7 +41,7 @@ int convertForTestingMain(int argc, const char *argv[]) { errs() << "error: " << Err.message() << "\n"; return 1; } - ObjectFile *OF = ObjErr.get().getBinary().get(); + ObjectFile *OF = ObjErr.get().getBinary(); auto BytesInAddress = OF->getBytesInAddress(); if (BytesInAddress != 8) { errs() << "error: 64 bit binary expected\n"; diff --git a/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp b/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp index 31bbedf8f03..760d83bf38a 100644 --- a/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -326,7 +326,7 @@ ObjectFile *LLVMSymbolizer::lookUpDsymFile(const std::string &ExePath, if (EC != errc::no_such_file_or_directory && !error(EC)) { OwningBinary<Binary> B = std::move(BinaryOrErr.get()); ObjectFile *DbgObj = - getObjectFileFromBinary(B.getBinary().get(), ArchName); + getObjectFileFromBinary(B.getBinary(), ArchName); const MachOObjectFile *MachDbgObj = dyn_cast<const MachOObjectFile>(DbgObj); if (!MachDbgObj) continue; @@ -350,7 +350,7 @@ LLVMSymbolizer::getOrCreateObjects(const std::string &Path, ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(Path); if (!error(BinaryOrErr.getError())) { OwningBinary<Binary> &B = BinaryOrErr.get(); - Obj = getObjectFileFromBinary(B.getBinary().get(), ArchName); + Obj = getObjectFileFromBinary(B.getBinary(), ArchName); if (!Obj) { ObjectPair Res = std::make_pair(nullptr, nullptr); ObjectPairForPathArch[std::make_pair(Path, ArchName)] = Res; @@ -369,7 +369,7 @@ LLVMSymbolizer::getOrCreateObjects(const std::string &Path, BinaryOrErr = createBinary(DebugBinaryPath); if (!error(BinaryOrErr.getError())) { OwningBinary<Binary> B = std::move(BinaryOrErr.get()); - DbgObj = getObjectFileFromBinary(B.getBinary().get(), ArchName); + DbgObj = getObjectFileFromBinary(B.getBinary(), ArchName); addOwningBinary(std::move(B)); } } diff --git a/llvm/tools/llvm-symbolizer/LLVMSymbolize.h b/llvm/tools/llvm-symbolizer/LLVMSymbolize.h index 52f1fc99171..db3f56237b4 100644 --- a/llvm/tools/llvm-symbolizer/LLVMSymbolize.h +++ b/llvm/tools/llvm-symbolizer/LLVMSymbolize.h @@ -81,9 +81,12 @@ private: // Owns all the parsed binaries and object files. SmallVector<std::unique_ptr<Binary>, 4> ParsedBinariesAndObjects; SmallVector<std::unique_ptr<MemoryBuffer>, 4> MemoryBuffers; - void addOwningBinary(OwningBinary<Binary> Bin) { - ParsedBinariesAndObjects.push_back(std::move(Bin.getBinary())); - MemoryBuffers.push_back(std::move(Bin.getBuffer())); + void addOwningBinary(OwningBinary<Binary> OwningBin) { + std::unique_ptr<Binary> Bin; + std::unique_ptr<MemoryBuffer> MemBuf; + std::tie(Bin, MemBuf) = OwningBin.takeBinary(); + ParsedBinariesAndObjects.push_back(std::move(Bin)); + MemoryBuffers.push_back(std::move(MemBuf)); } // Owns module info objects. |