[BOLT][NFC] Get rid of BestFit parameter

Summary: The parameter is no longer used.

(cherry picked from FBD20236516)
This commit is contained in:
Maksim Panchenko 2020-03-03 14:28:42 -08:00
parent b0cbb60165
commit c7e012e145
2 changed files with 10 additions and 19 deletions

View File

@ -883,20 +883,13 @@ MCSymbol *BinaryContext::registerNameAtAddress(StringRef Name,
const BinaryData *
BinaryContext::getBinaryDataContainingAddressImpl(uint64_t Address,
bool IncludeEnd,
bool BestFit) const {
bool IncludeEnd) const {
auto NI = BinaryDataMap.lower_bound(Address);
auto End = BinaryDataMap.end();
if ((NI != End && Address == NI->first && !IncludeEnd) ||
((NI != BinaryDataMap.begin()) && (NI-- != BinaryDataMap.begin()))) {
if (NI->second->containsAddress(Address) ||
(IncludeEnd && NI->second->getEndAddress() == Address)) {
while (BestFit &&
std::next(NI) != End &&
(std::next(NI)->second->containsAddress(Address) ||
(IncludeEnd && std::next(NI)->second->getEndAddress() == Address))) {
++NI;
}
return NI->second;
}

View File

@ -271,8 +271,7 @@ public:
/// the start address and size for each symbol). Returns a pointer to
/// the BinaryData for that symbol. If no data is found, nullptr is returned.
const BinaryData *getBinaryDataContainingAddressImpl(uint64_t Address,
bool IncludeEnd,
bool BestFit) const;
bool IncludeEnd) const;
/// Update the Parent fields in BinaryDatas after adding a new entry into
/// \p BinaryDataMap.
@ -620,18 +619,17 @@ public:
/// Look up the symbol entry that contains the given \p Address (based on
/// the start address and size for each symbol). Returns a pointer to
/// the BinaryData for that symbol. If no data is found, nullptr is returned.
const BinaryData *getBinaryDataContainingAddress(uint64_t Address,
bool IncludeEnd = false,
bool BestFit = false) const {
return getBinaryDataContainingAddressImpl(Address, IncludeEnd, BestFit);
const BinaryData *
getBinaryDataContainingAddress(uint64_t Address,
bool IncludeEnd = false) const {
return getBinaryDataContainingAddressImpl(Address, IncludeEnd);
}
BinaryData *getBinaryDataContainingAddress(uint64_t Address,
bool IncludeEnd = false,
bool BestFit = false) {
return const_cast<BinaryData *>(getBinaryDataContainingAddressImpl(Address,
IncludeEnd,
BestFit));
bool IncludeEnd = false) {
return
const_cast<BinaryData *>(getBinaryDataContainingAddressImpl(Address,
IncludeEnd));
}
/// Return BinaryData for the given \p Name or nullptr if no