Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2018 16:30:03 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r337641 - in vendor/lldb/dist-release_70: include/lldb/Utility source/Utility
Message-ID:  <201808111630.w7BGU3lv020486@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Aug 11 16:30:02 2018
New Revision: 337641
URL: https://svnweb.freebsd.org/changeset/base/337641

Log:
  Vendor import of lldb release_70 branch r339355:
  https://llvm.org/svn/llvm-project/lldb/branches/release_70@339355

Modified:
  vendor/lldb/dist-release_70/include/lldb/Utility/VMRange.h
  vendor/lldb/dist-release_70/source/Utility/VMRange.cpp

Modified: vendor/lldb/dist-release_70/include/lldb/Utility/VMRange.h
==============================================================================
--- vendor/lldb/dist-release_70/include/lldb/Utility/VMRange.h	Sat Aug 11 16:29:59 2018	(r337640)
+++ vendor/lldb/dist-release_70/include/lldb/Utility/VMRange.h	Sat Aug 11 16:30:02 2018	(r337641)
@@ -87,24 +87,6 @@ class VMRange { (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);
 

Modified: vendor/lldb/dist-release_70/source/Utility/VMRange.cpp
==============================================================================
--- vendor/lldb/dist-release_70/source/Utility/VMRange.cpp	Sat Aug 11 16:29:59 2018	(r337640)
+++ vendor/lldb/dist-release_70/source/Utility/VMRange.cpp	Sat Aug 11 16:30:02 2018	(r337641)
@@ -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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808111630.w7BGU3lv020486>