}
static bool checkFileCRC(StringRef Path, uint32_t CRCHash) {
- std::unique_ptr<MemoryBuffer> MB;
- if (MemoryBuffer::getFileOrSTDIN(Path, MB))
+ ErrorOr<std::unique_ptr<MemoryBuffer>> MB =
+ MemoryBuffer::getFileOrSTDIN(Path);
+ if (!MB)
return false;
- return !zlib::isAvailable() || CRCHash == zlib::crc32(MB->getBuffer());
+ return !zlib::isAvailable() || CRCHash == zlib::crc32(MB.get()->getBuffer());
}
static bool findDebugBinary(const std::string &OrigPath,
std::make_pair(UB, ArchName));
if (I != ObjectFileForArch.end())
return I->second;
- std::unique_ptr<ObjectFile> ParsedObj;
- if (!UB->getObjectForArch(Triple(ArchName).getArch(), ParsedObj)) {
- Res = ParsedObj.get();
- ParsedBinariesAndObjects.push_back(std::move(ParsedObj));
+ ErrorOr<std::unique_ptr<ObjectFile>> ParsedObj =
+ UB->getObjectForArch(Triple(ArchName).getArch());
+ if (ParsedObj) {
+ Res = ParsedObj.get().get();
+ ParsedBinariesAndObjects.push_back(std::move(ParsedObj.get()));
}
ObjectFileForArch[std::make_pair(UB, ArchName)] = Res;
} else if (Bin->isObject()) {