[BOLT][NFC] Remove another unused function

Summary: Remove DataReader::getBranchRange().

(cherry picked from FBD32810933)
This commit is contained in:
Maksim Panchenko 2021-12-02 13:41:59 -08:00
parent cf624f2e63
commit 226c973280
2 changed files with 0 additions and 19 deletions

View File

@ -133,10 +133,6 @@ struct FuncBranchData {
/// undefined.
ErrorOr<const BranchInfo &> getDirectCallBranch(uint64_t From) const;
/// Find all the branches originating at From.
iterator_range<ContainerTy::const_iterator>
getBranchRange(uint64_t From) const;
/// Append the branch data of another function located \p Offset bytes away
/// from the entry of this function.
void appendFrom(const FuncBranchData &FBD, uint64_t Offset);

View File

@ -82,21 +82,6 @@ raw_ostream &operator<<(raw_ostream &OS, const Location &Loc) {
return OS;
}
iterator_range<FuncBranchData::ContainerTy::const_iterator>
FuncBranchData::getBranchRange(uint64_t From) const {
assert(std::is_sorted(Data.begin(), Data.end()));
struct Compare {
bool operator()(const BranchInfo &BI, const uint64_t Val) const {
return BI.From.Offset < Val;
}
bool operator()(const uint64_t Val, const BranchInfo &BI) const {
return Val < BI.From.Offset;
}
};
auto Range = std::equal_range(Data.begin(), Data.end(), From, Compare());
return iterator_range<ContainerTy::const_iterator>(Range.first, Range.second);
}
void FuncBranchData::appendFrom(const FuncBranchData &FBD, uint64_t Offset) {
Data.insert(Data.end(), FBD.Data.begin(), FBD.Data.end());
for (auto I = Data.begin(), E = Data.end(); I != E; ++I) {