[BOLT] Make the methods isText/isData more robust

Summary: Make the methods isText/isData work for MachO.

(cherry picked from FBD19849460)
This commit is contained in:
Alexander Shaposhnikov
2020-02-11 17:54:48 -08:00
committed by Maksim Panchenko
parent c3c4b15a2e
commit d5b8fc8fbe
2 changed files with 12 additions and 3 deletions

View File

@@ -24,6 +24,10 @@ extern cl::opt<bool> PrintRelocations;
extern cl::opt<bool> HotData;
}
bool BinarySection::isELF() const {
return BC.Ctx->getObjectFileInfo()->getTargetTriple().isOSBinFormatELF();
}
uint64_t
BinarySection::hash(const BinaryData &BD,
std::map<const BinaryData *, uint64_t> &Cache) const {