aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-11 16:30:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-11 16:30:02 +0000
commite984e73e538ddaa390659357b6ed6fec7e41fa7c (patch)
tree57b9156c7479d76634e0cf83298eea53d0af53d3
parent39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff)
downloadsrc-vendor/lldb/lldb-release_70-r339355.tar.gz
src-vendor/lldb/lldb-release_70-r339355.zip
Vendor import of lldb release_70 branch r339355:vendor/lldb/lldb-release_70-r339355
-rw-r--r--include/lldb/Utility/VMRange.h18
-rw-r--r--source/Utility/VMRange.cpp10
2 files changed, 6 insertions, 22 deletions
diff --git a/include/lldb/Utility/VMRange.h b/include/lldb/Utility/VMRange.h
index f03a1b0c1f97..0e696907baa7 100644
--- a/include/lldb/Utility/VMRange.h
+++ b/include/lldb/Utility/VMRange.h
@@ -87,24 +87,6 @@ public:
void Dump(Stream *s, lldb::addr_t base_addr = 0,
uint32_t addr_width = 8) const;
- class ValueInRangeUnaryPredicate {
- public:
- ValueInRangeUnaryPredicate(lldb::addr_t value) : _value(value) {}
- bool operator()(const VMRange &range) const {
- return range.Contains(_value);
- }
- lldb::addr_t _value;
- };
-
- class RangeInRangeUnaryPredicate {
- public:
- RangeInRangeUnaryPredicate(VMRange range) : _range(range) {}
- bool operator()(const VMRange &range) const {
- return range.Contains(_range);
- }
- const VMRange &_range;
- };
-
static bool ContainsValue(const VMRange::collection &coll,
lldb::addr_t value);
diff --git a/source/Utility/VMRange.cpp b/source/Utility/VMRange.cpp
index 105b1a58c48c..7e35d3ef0c65 100644
--- a/source/Utility/VMRange.cpp
+++ b/source/Utility/VMRange.cpp
@@ -24,14 +24,16 @@ using namespace lldb_private;
bool VMRange::ContainsValue(const VMRange::collection &coll,
lldb::addr_t value) {
- ValueInRangeUnaryPredicate in_range_predicate(value);
- return llvm::find_if(coll, in_range_predicate) != coll.end();
+ return llvm::find_if(coll, [&](const VMRange &r) {
+ return r.Contains(value);
+ }) != coll.end();
}
bool VMRange::ContainsRange(const VMRange::collection &coll,
const VMRange &range) {
- RangeInRangeUnaryPredicate in_range_predicate(range);
- return llvm::find_if(coll, in_range_predicate) != coll.end();
+ return llvm::find_if(coll, [&](const VMRange &r) {
+ return r.Contains(range);
+ }) != coll.end();
}
void VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) const {