summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-28 08:58:05 +0000
committerFangrui Song <maskray@google.com>2019-06-28 08:58:05 +0000
commite662b6985a8af483a4e7c541f8b67628452d147f (patch)
tree8c4118dd421a5eb65d44a5f64d6523f486c8ef50 /llvm/lib/DebugInfo
parent07e53fee1453d1a48e4550fb9cdb0c042587b496 (diff)
downloadbcm5719-llvm-e662b6985a8af483a4e7c541f8b67628452d147f.tar.gz
bcm5719-llvm-e662b6985a8af483a4e7c541f8b67628452d147f.zip
[DebugInfo] GSYM cleanups after D63104/r364427
llvm-svn: 364634
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/GSYM/Range.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/GSYM/Range.cpp b/llvm/lib/DebugInfo/GSYM/Range.cpp
index bd10067013f..57e664d825a 100644
--- a/llvm/lib/DebugInfo/GSYM/Range.cpp
+++ b/llvm/lib/DebugInfo/GSYM/Range.cpp
@@ -44,14 +44,10 @@ void AddressRanges::insert(const AddressRange &Range) {
}
bool AddressRanges::contains(uint64_t Addr) const {
- if (Ranges.empty())
- return false;
- auto Begin = Ranges.begin();
- auto Pos = std::upper_bound(Begin, Ranges.end(), Addr);
- if (Pos == Begin)
- return false;
- --Pos;
- return Pos->contains(Addr);
+ auto It = std::partition_point(
+ Ranges.begin(), Ranges.end(),
+ [=](const AddressRange &R) { return R.startAddress() <= Addr; });
+ return It != Ranges.begin() && It[-1].contains(Addr);
}
raw_ostream &llvm::gsym::operator<<(raw_ostream &OS, const AddressRange &R) {
OpenPOWER on IntegriCloud