summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp4
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp10
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp7
3 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
index a28313676eb..010b0106a83 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
@@ -115,9 +115,7 @@ void DWARFDebugAranges::construct() {
uint32_t DWARFDebugAranges::findAddress(uint64_t Address) const {
RangeCollIterator It =
- llvm::upper_bound(Aranges, Address, [](uint64_t LHS, Range RHS) {
- return LHS < RHS.HighPC();
- });
+ llvm::bsearch(Aranges, [=](Range RHS) { return Address < RHS.HighPC(); });
if (It != Aranges.end() && It->LowPC <= Address)
return It->CUOffset;
return -1U;
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
index 7c80b3bb3e9..e0d62215d9b 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
@@ -57,9 +57,8 @@ void DWARFDebugLoc::LocationList::dump(raw_ostream &OS, bool IsLittleEndian,
DWARFDebugLoc::LocationList const *
DWARFDebugLoc::getLocationListAtOffset(uint64_t Offset) const {
- auto It = llvm::lower_bound(
- Locations, Offset,
- [](const LocationList &L, uint64_t Offset) { return L.Offset < Offset; });
+ auto It = llvm::bsearch(
+ Locations, [=](const LocationList &L) { return Offset <= L.Offset; });
if (It != Locations.end() && It->Offset == Offset)
return &(*It);
return nullptr;
@@ -213,9 +212,8 @@ void DWARFDebugLoclists::parse(DataExtractor data, unsigned Version) {
DWARFDebugLoclists::LocationList const *
DWARFDebugLoclists::getLocationListAtOffset(uint64_t Offset) const {
- auto It = llvm::lower_bound(
- Locations, Offset,
- [](const LocationList &L, uint64_t Offset) { return L.Offset < Offset; });
+ auto It = llvm::bsearch(
+ Locations, [=](const LocationList &L) { return Offset <= L.Offset; });
if (It != Locations.end() && It->Offset == Offset)
return &(*It);
return nullptr;
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
index 8225a26d64c..cff5c288d06 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
@@ -172,10 +172,9 @@ DWARFUnitIndex::getFromOffset(uint32_t Offset) const {
E2->Contributions[InfoColumn].Offset;
});
}
- auto I =
- llvm::upper_bound(OffsetLookup, Offset, [&](uint32_t Offset, Entry *E2) {
- return Offset < E2->Contributions[InfoColumn].Offset;
- });
+ auto I = llvm::bsearch(OffsetLookup, [&](Entry *E2) {
+ return Offset < E2->Contributions[InfoColumn].Offset;
+ });
if (I == OffsetLookup.begin())
return nullptr;
--I;
OpenPOWER on IntegriCloud