mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[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
This commit is contained in:
@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user