/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Utility/RangeMap.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- RangeMap.h ----------------------------------------------*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #ifndef LLDB_UTILITY_RANGEMAP_H |
10 | | #define LLDB_UTILITY_RANGEMAP_H |
11 | | |
12 | | #include <algorithm> |
13 | | #include <vector> |
14 | | |
15 | | #include "llvm/ADT/SmallVector.h" |
16 | | |
17 | | #include "lldb/lldb-private.h" |
18 | | |
19 | | // Uncomment to make sure all Range objects are sorted when needed |
20 | | //#define ASSERT_RANGEMAP_ARE_SORTED |
21 | | |
22 | | namespace lldb_private { |
23 | | |
24 | | // Templatized classes for dealing with generic ranges and also collections of |
25 | | // ranges, or collections of ranges that have associated data. |
26 | | |
27 | | // A simple range class where you get to define the type of the range |
28 | | // base "B", and the type used for the range byte size "S". |
29 | | template <typename B, typename S> struct Range { |
30 | | typedef B BaseType; |
31 | | typedef S SizeType; |
32 | | |
33 | | BaseType base; |
34 | | SizeType size; |
35 | | |
36 | 2.35M | Range() : base(0), size(0) {} lldb_private::Range<unsigned int, unsigned int>::Range() Line | Count | Source | 36 | 44 | Range() : base(0), size(0) {} |
lldb_private::Range<unsigned long long, unsigned long long>::Range() Line | Count | Source | 36 | 2.34M | Range() : base(0), size(0) {} |
lldb_private::Range<unsigned long long, unsigned int>::Range() Line | Count | Source | 36 | 14.7k | Range() : base(0), size(0) {} |
|
37 | | |
38 | 44.5M | Range(BaseType b, SizeType s) : base(b), size(s) {} lldb_private::Range<unsigned int, unsigned int>::Range(unsigned int, unsigned int) Line | Count | Source | 38 | 4.49k | Range(BaseType b, SizeType s) : base(b), size(s) {} |
lldb_private::Range<unsigned long long, unsigned int>::Range(unsigned long long, unsigned int) Line | Count | Source | 38 | 1.81M | Range(BaseType b, SizeType s) : base(b), size(s) {} |
lldb_private::Range<unsigned long long, unsigned long long>::Range(unsigned long long, unsigned long long) Line | Count | Source | 38 | 42.6M | Range(BaseType b, SizeType s) : base(b), size(s) {} |
lldb_private::Range<unsigned long long, unsigned long>::Range(unsigned long long, unsigned long) Line | Count | Source | 38 | 2 | Range(BaseType b, SizeType s) : base(b), size(s) {} |
|
39 | | |
40 | 0 | void Clear(BaseType b = 0) { |
41 | 0 | base = b; |
42 | 0 | size = 0; |
43 | 0 | } Unexecuted instantiation: lldb_private::Range<unsigned int, unsigned int>::Clear(unsigned int) Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long long>::Clear(unsigned long long) |
44 | | |
45 | 704M | BaseType GetRangeBase() const { return base; } lldb_private::Range<unsigned long long, unsigned int>::GetRangeBase() const Line | Count | Source | 45 | 14.1M | BaseType GetRangeBase() const { return base; } |
lldb_private::Range<unsigned long long, unsigned long long>::GetRangeBase() const Line | Count | Source | 45 | 690M | BaseType GetRangeBase() const { return base; } |
lldb_private::Range<unsigned int, unsigned int>::GetRangeBase() const Line | Count | Source | 45 | 5.50k | BaseType GetRangeBase() const { return base; } |
lldb_private::Range<unsigned long long, unsigned long>::GetRangeBase() const Line | Count | Source | 45 | 4 | BaseType GetRangeBase() const { return base; } |
|
46 | | |
47 | | /// Set the start value for the range, and keep the same size |
48 | 132M | void SetRangeBase(BaseType b) { base = b; } lldb_private::Range<unsigned int, unsigned int>::SetRangeBase(unsigned int) Line | Count | Source | 48 | 44 | void SetRangeBase(BaseType b) { base = b; } |
lldb_private::Range<unsigned long long, unsigned int>::SetRangeBase(unsigned long long) Line | Count | Source | 48 | 45.3k | void SetRangeBase(BaseType b) { base = b; } |
lldb_private::Range<unsigned long long, unsigned long long>::SetRangeBase(unsigned long long) Line | Count | Source | 48 | 132M | void SetRangeBase(BaseType b) { base = b; } |
Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long>::SetRangeBase(unsigned long long) |
49 | | |
50 | 4.18k | void Slide(BaseType slide) { base += slide; } |
51 | | |
52 | 0 | void ShrinkFront(S s) { |
53 | 0 | base += s; |
54 | 0 | size -= std::min(s, size); |
55 | 0 | } |
56 | | |
57 | 36.1k | bool Union(const Range &rhs) { |
58 | 36.1k | if (DoesAdjoinOrIntersect(rhs)) { |
59 | 21.0k | auto new_end = std::max<BaseType>(GetRangeEnd(), rhs.GetRangeEnd()); |
60 | 21.0k | base = std::min<BaseType>(base, rhs.base); |
61 | 21.0k | size = new_end - base; |
62 | 21.0k | return true; |
63 | 21.0k | } |
64 | 15.1k | return false; |
65 | 36.1k | } lldb_private::Range<unsigned long long, unsigned int>::Union(lldb_private::Range<unsigned long long, unsigned int> const&) Line | Count | Source | 57 | 36.1k | bool Union(const Range &rhs) { | 58 | 36.1k | if (DoesAdjoinOrIntersect(rhs)) { | 59 | 21.0k | auto new_end = std::max<BaseType>(GetRangeEnd(), rhs.GetRangeEnd()); | 60 | 21.0k | base = std::min<BaseType>(base, rhs.base); | 61 | 21.0k | size = new_end - base; | 62 | 21.0k | return true; | 63 | 21.0k | } | 64 | 15.1k | return false; | 65 | 36.1k | } |
Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long>::Union(lldb_private::Range<unsigned long long, unsigned long> const&) |
66 | | |
67 | 49.0k | Range Intersect(const Range &rhs) const { |
68 | 49.0k | const BaseType lhs_base = this->GetRangeBase(); |
69 | 49.0k | const BaseType rhs_base = rhs.GetRangeBase(); |
70 | 49.0k | const BaseType lhs_end = this->GetRangeEnd(); |
71 | 49.0k | const BaseType rhs_end = rhs.GetRangeEnd(); |
72 | 49.0k | Range range; |
73 | 49.0k | range.SetRangeBase(std::max(lhs_base, rhs_base)); |
74 | 49.0k | range.SetRangeEnd(std::min(lhs_end, rhs_end)); |
75 | 49.0k | return range; |
76 | 49.0k | } lldb_private::Range<unsigned long long, unsigned int>::Intersect(lldb_private::Range<unsigned long long, unsigned int> const&) const Line | Count | Source | 67 | 6.25k | Range Intersect(const Range &rhs) const { | 68 | 6.25k | const BaseType lhs_base = this->GetRangeBase(); | 69 | 6.25k | const BaseType rhs_base = rhs.GetRangeBase(); | 70 | 6.25k | const BaseType lhs_end = this->GetRangeEnd(); | 71 | 6.25k | const BaseType rhs_end = rhs.GetRangeEnd(); | 72 | 6.25k | Range range; | 73 | 6.25k | range.SetRangeBase(std::max(lhs_base, rhs_base)); | 74 | 6.25k | range.SetRangeEnd(std::min(lhs_end, rhs_end)); | 75 | 6.25k | return range; | 76 | 6.25k | } |
lldb_private::Range<unsigned long long, unsigned long long>::Intersect(lldb_private::Range<unsigned long long, unsigned long long> const&) const Line | Count | Source | 67 | 42.8k | Range Intersect(const Range &rhs) const { | 68 | 42.8k | const BaseType lhs_base = this->GetRangeBase(); | 69 | 42.8k | const BaseType rhs_base = rhs.GetRangeBase(); | 70 | 42.8k | const BaseType lhs_end = this->GetRangeEnd(); | 71 | 42.8k | const BaseType rhs_end = rhs.GetRangeEnd(); | 72 | 42.8k | Range range; | 73 | 42.8k | range.SetRangeBase(std::max(lhs_base, rhs_base)); | 74 | 42.8k | range.SetRangeEnd(std::min(lhs_end, rhs_end)); | 75 | 42.8k | return range; | 76 | 42.8k | } |
|
77 | | |
78 | 68.3M | BaseType GetRangeEnd() const { return base + size; } lldb_private::Range<unsigned long long, unsigned int>::GetRangeEnd() const Line | Count | Source | 78 | 9.32M | BaseType GetRangeEnd() const { return base + size; } |
lldb_private::Range<unsigned int, unsigned int>::GetRangeEnd() const Line | Count | Source | 78 | 3.11k | BaseType GetRangeEnd() const { return base + size; } |
lldb_private::Range<unsigned long long, unsigned long long>::GetRangeEnd() const Line | Count | Source | 78 | 58.9M | BaseType GetRangeEnd() const { return base + size; } |
lldb_private::Range<unsigned long long, unsigned long>::GetRangeEnd() const Line | Count | Source | 78 | 3 | BaseType GetRangeEnd() const { return base + size; } |
|
79 | | |
80 | 83.0k | void SetRangeEnd(BaseType end) { |
81 | 83.0k | if (end > base) |
82 | 34.7k | size = end - base; |
83 | 48.3k | else |
84 | 48.3k | size = 0; |
85 | 83.0k | } lldb_private::Range<unsigned int, unsigned int>::SetRangeEnd(unsigned int) Line | Count | Source | 80 | 48 | void SetRangeEnd(BaseType end) { | 81 | 48 | if (end > base) | 82 | 32 | size = end - base; | 83 | 16 | else | 84 | 16 | size = 0; | 85 | 48 | } |
lldb_private::Range<unsigned long long, unsigned int>::SetRangeEnd(unsigned long long) Line | Count | Source | 80 | 36.8k | void SetRangeEnd(BaseType end) { | 81 | 36.8k | if (end > base) | 82 | 30.6k | size = end - base; | 83 | 6.19k | else | 84 | 6.19k | size = 0; | 85 | 36.8k | } |
lldb_private::Range<unsigned long long, unsigned long long>::SetRangeEnd(unsigned long long) Line | Count | Source | 80 | 46.2k | void SetRangeEnd(BaseType end) { | 81 | 46.2k | if (end > base) | 82 | 4.10k | size = end - base; | 83 | 42.1k | else | 84 | 42.1k | size = 0; | 85 | 46.2k | } |
|
86 | | |
87 | 166M | SizeType GetByteSize() const { return size; } lldb_private::Range<unsigned long long, unsigned int>::GetByteSize() const Line | Count | Source | 87 | 55.1k | SizeType GetByteSize() const { return size; } |
lldb_private::Range<unsigned int, unsigned int>::GetByteSize() const Line | Count | Source | 87 | 276 | SizeType GetByteSize() const { return size; } |
lldb_private::Range<unsigned long long, unsigned long long>::GetByteSize() const Line | Count | Source | 87 | 166M | SizeType GetByteSize() const { return size; } |
lldb_private::Range<unsigned long long, unsigned long>::GetByteSize() const Line | Count | Source | 87 | 1 | SizeType GetByteSize() const { return size; } |
|
88 | | |
89 | 168M | void SetByteSize(SizeType s) { size = s; } lldb_private::Range<unsigned int, unsigned int>::SetByteSize(unsigned int) Line | Count | Source | 89 | 12 | void SetByteSize(SizeType s) { size = s; } |
lldb_private::Range<unsigned long long, unsigned long long>::SetByteSize(unsigned long long) Line | Count | Source | 89 | 167M | void SetByteSize(SizeType s) { size = s; } |
lldb_private::Range<unsigned long long, unsigned int>::SetByteSize(unsigned int) Line | Count | Source | 89 | 78.1k | void SetByteSize(SizeType s) { size = s; } |
Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long>::SetByteSize(unsigned long) |
90 | | |
91 | 141k | bool IsValid() const { return size > 0; } lldb_private::Range<unsigned long long, unsigned int>::IsValid() const Line | Count | Source | 91 | 6.26k | bool IsValid() const { return size > 0; } |
lldb_private::Range<unsigned long long, unsigned long long>::IsValid() const Line | Count | Source | 91 | 135k | bool IsValid() const { return size > 0; } |
|
92 | | |
93 | 85.2M | bool Contains(BaseType r) const { |
94 | 85.2M | return (GetRangeBase() <= r) && (r < GetRangeEnd())50.1M ; |
95 | 85.2M | } lldb_private::Range<unsigned long long, unsigned int>::Contains(unsigned long long) const Line | Count | Source | 93 | 3.09M | bool Contains(BaseType r) const { | 94 | 3.09M | return (GetRangeBase() <= r) && (r < GetRangeEnd())3.09M ; | 95 | 3.09M | } |
lldb_private::Range<unsigned int, unsigned int>::Contains(unsigned int) const Line | Count | Source | 93 | 1.11k | bool Contains(BaseType r) const { | 94 | 1.11k | return (GetRangeBase() <= r) && (r < GetRangeEnd())1.10k ; | 95 | 1.11k | } |
lldb_private::Range<unsigned long long, unsigned long long>::Contains(unsigned long long) const Line | Count | Source | 93 | 82.1M | bool Contains(BaseType r) const { | 94 | 82.1M | return (GetRangeBase() <= r) && (r < GetRangeEnd())47.0M ; | 95 | 82.1M | } |
lldb_private::Range<unsigned long long, unsigned long>::Contains(unsigned long long) const Line | Count | Source | 93 | 1 | bool Contains(BaseType r) const { | 94 | 1 | return (GetRangeBase() <= r) && (r < GetRangeEnd()); | 95 | 1 | } |
|
96 | | |
97 | 8.69M | bool ContainsEndInclusive(BaseType r) const { |
98 | 8.69M | return (GetRangeBase() <= r) && (r <= GetRangeEnd())8.69M ; |
99 | 8.69M | } lldb_private::Range<unsigned int, unsigned int>::ContainsEndInclusive(unsigned int) const Line | Count | Source | 97 | 772 | bool ContainsEndInclusive(BaseType r) const { | 98 | 772 | return (GetRangeBase() <= r) && (r <= GetRangeEnd()); | 99 | 772 | } |
lldb_private::Range<unsigned long long, unsigned int>::ContainsEndInclusive(unsigned long long) const Line | Count | Source | 97 | 3.00M | bool ContainsEndInclusive(BaseType r) const { | 98 | 3.00M | return (GetRangeBase() <= r) && (r <= GetRangeEnd())3.00M ; | 99 | 3.00M | } |
lldb_private::Range<unsigned long long, unsigned long long>::ContainsEndInclusive(unsigned long long) const Line | Count | Source | 97 | 5.68M | bool ContainsEndInclusive(BaseType r) const { | 98 | 5.68M | return (GetRangeBase() <= r) && (r <= GetRangeEnd()); | 99 | 5.68M | } |
lldb_private::Range<unsigned long long, unsigned long>::ContainsEndInclusive(unsigned long long) const Line | Count | Source | 97 | 1 | bool ContainsEndInclusive(BaseType r) const { | 98 | 1 | return (GetRangeBase() <= r) && (r <= GetRangeEnd()); | 99 | 1 | } |
|
100 | | |
101 | 12.7M | bool Contains(const Range &range) const { |
102 | 12.7M | return Contains(range.GetRangeBase()) && |
103 | 12.7M | ContainsEndInclusive(range.GetRangeEnd())8.69M ; |
104 | 12.7M | } lldb_private::Range<unsigned int, unsigned int>::Contains(lldb_private::Range<unsigned int, unsigned int> const&) const Line | Count | Source | 101 | 778 | bool Contains(const Range &range) const { | 102 | 778 | return Contains(range.GetRangeBase()) && | 103 | 778 | ContainsEndInclusive(range.GetRangeEnd())772 ; | 104 | 778 | } |
lldb_private::Range<unsigned long long, unsigned int>::Contains(lldb_private::Range<unsigned long long, unsigned int> const&) const Line | Count | Source | 101 | 3.03M | bool Contains(const Range &range) const { | 102 | 3.03M | return Contains(range.GetRangeBase()) && | 103 | 3.03M | ContainsEndInclusive(range.GetRangeEnd())3.00M ; | 104 | 3.03M | } |
lldb_private::Range<unsigned long long, unsigned long long>::Contains(lldb_private::Range<unsigned long long, unsigned long long> const&) const Line | Count | Source | 101 | 9.71M | bool Contains(const Range &range) const { | 102 | 9.71M | return Contains(range.GetRangeBase()) && | 103 | 9.71M | ContainsEndInclusive(range.GetRangeEnd())5.68M ; | 104 | 9.71M | } |
lldb_private::Range<unsigned long long, unsigned long>::Contains(lldb_private::Range<unsigned long long, unsigned long> const&) const Line | Count | Source | 101 | 1 | bool Contains(const Range &range) const { | 102 | 1 | return Contains(range.GetRangeBase()) && | 103 | 1 | ContainsEndInclusive(range.GetRangeEnd()); | 104 | 1 | } |
|
105 | | |
106 | | // Returns true if the two ranges adjoing or intersect |
107 | 36.2k | bool DoesAdjoinOrIntersect(const Range &rhs) const { |
108 | 36.2k | const BaseType lhs_base = this->GetRangeBase(); |
109 | 36.2k | const BaseType rhs_base = rhs.GetRangeBase(); |
110 | 36.2k | const BaseType lhs_end = this->GetRangeEnd(); |
111 | 36.2k | const BaseType rhs_end = rhs.GetRangeEnd(); |
112 | 36.2k | bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base)31.1k ; |
113 | 36.2k | return result; |
114 | 36.2k | } lldb_private::Range<unsigned int, unsigned int>::DoesAdjoinOrIntersect(lldb_private::Range<unsigned int, unsigned int> const&) const Line | Count | Source | 107 | 107 | bool DoesAdjoinOrIntersect(const Range &rhs) const { | 108 | 107 | const BaseType lhs_base = this->GetRangeBase(); | 109 | 107 | const BaseType rhs_base = rhs.GetRangeBase(); | 110 | 107 | const BaseType lhs_end = this->GetRangeEnd(); | 111 | 107 | const BaseType rhs_end = rhs.GetRangeEnd(); | 112 | 107 | bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base); | 113 | 107 | return result; | 114 | 107 | } |
lldb_private::Range<unsigned long long, unsigned int>::DoesAdjoinOrIntersect(lldb_private::Range<unsigned long long, unsigned int> const&) const Line | Count | Source | 107 | 36.1k | bool DoesAdjoinOrIntersect(const Range &rhs) const { | 108 | 36.1k | const BaseType lhs_base = this->GetRangeBase(); | 109 | 36.1k | const BaseType rhs_base = rhs.GetRangeBase(); | 110 | 36.1k | const BaseType lhs_end = this->GetRangeEnd(); | 111 | 36.1k | const BaseType rhs_end = rhs.GetRangeEnd(); | 112 | 36.1k | bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base)31.0k ; | 113 | 36.1k | return result; | 114 | 36.1k | } |
Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long>::DoesAdjoinOrIntersect(lldb_private::Range<unsigned long long, unsigned long> const&) const |
115 | | |
116 | | // Returns true if the two ranges intersect |
117 | 49.0k | bool DoesIntersect(const Range &rhs) const { |
118 | 49.0k | return Intersect(rhs).IsValid(); |
119 | 49.0k | } lldb_private::Range<unsigned long long, unsigned int>::DoesIntersect(lldb_private::Range<unsigned long long, unsigned int> const&) const Line | Count | Source | 117 | 6.25k | bool DoesIntersect(const Range &rhs) const { | 118 | 6.25k | return Intersect(rhs).IsValid(); | 119 | 6.25k | } |
lldb_private::Range<unsigned long long, unsigned long long>::DoesIntersect(lldb_private::Range<unsigned long long, unsigned long long> const&) const Line | Count | Source | 117 | 42.8k | bool DoesIntersect(const Range &rhs) const { | 118 | 42.8k | return Intersect(rhs).IsValid(); | 119 | 42.8k | } |
|
120 | | |
121 | 1.82M | bool operator<(const Range &rhs) const { |
122 | 1.82M | if (base == rhs.base) |
123 | 65 | return size < rhs.size; |
124 | 1.82M | return base < rhs.base; |
125 | 1.82M | } lldb_private::Range<unsigned long long, unsigned long long>::operator<(lldb_private::Range<unsigned long long, unsigned long long> const&) const Line | Count | Source | 121 | 1.69M | bool operator<(const Range &rhs) const { | 122 | 1.69M | if (base == rhs.base) | 123 | 50 | return size < rhs.size; | 124 | 1.69M | return base < rhs.base; | 125 | 1.69M | } |
lldb_private::Range<unsigned int, unsigned int>::operator<(lldb_private::Range<unsigned int, unsigned int> const&) const Line | Count | Source | 121 | 116 | bool operator<(const Range &rhs) const { | 122 | 116 | if (base == rhs.base) | 123 | 11 | return size < rhs.size; | 124 | 105 | return base < rhs.base; | 125 | 116 | } |
lldb_private::Range<unsigned long long, unsigned int>::operator<(lldb_private::Range<unsigned long long, unsigned int> const&) const Line | Count | Source | 121 | 122k | bool operator<(const Range &rhs) const { | 122 | 122k | if (base == rhs.base) | 123 | 4 | return size < rhs.size; | 124 | 122k | return base < rhs.base; | 125 | 122k | } |
Unexecuted instantiation: lldb_private::Range<unsigned long long, unsigned long>::operator<(lldb_private::Range<unsigned long long, unsigned long> const&) const |
126 | | |
127 | 865 | bool operator==(const Range &rhs) const { |
128 | 865 | return base == rhs.base && size == rhs.size667 ; |
129 | 865 | } |
130 | | |
131 | | bool operator!=(const Range &rhs) const { |
132 | | return base != rhs.base || size != rhs.size; |
133 | | } |
134 | | }; |
135 | | |
136 | | template <typename B, typename S, unsigned N = 0> class RangeVector { |
137 | | public: |
138 | | typedef B BaseType; |
139 | | typedef S SizeType; |
140 | | typedef Range<B, S> Entry; |
141 | | typedef llvm::SmallVector<Entry, N> Collection; |
142 | | |
143 | 937k | RangeVector() = default; lldb_private::RangeVector<unsigned int, unsigned int, 0u>::RangeVector() Line | Count | Source | 143 | 114k | RangeVector() = default; |
lldb_private::RangeVector<unsigned int, unsigned int, 8u>::RangeVector() Line | Count | Source | 143 | 113k | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::RangeVector() Line | Count | Source | 143 | 11.8k | RangeVector() = default; |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::RangeVector() Line | Count | Source | 143 | 7.22k | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::RangeVector() Line | Count | Source | 143 | 130k | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::RangeVector() Line | Count | Source | 143 | 2.67k | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::RangeVector() Line | Count | Source | 143 | 2 | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::RangeVector() Line | Count | Source | 143 | 555k | RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::RangeVector() Line | Count | Source | 143 | 2.24k | RangeVector() = default; |
|
144 | | |
145 | 1.06M | ~RangeVector() = default; lldb_private::RangeVector<unsigned int, unsigned int, 8u>::~RangeVector() Line | Count | Source | 145 | 227k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::~RangeVector() Line | Count | Source | 145 | 11.8k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned int, unsigned int, 0u>::~RangeVector() Line | Count | Source | 145 | 108k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::~RangeVector() Line | Count | Source | 145 | 7.03k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::~RangeVector() Line | Count | Source | 145 | 147k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::~RangeVector() Line | Count | Source | 145 | 2.56k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::~RangeVector() Line | Count | Source | 145 | 2 | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::~RangeVector() Line | Count | Source | 145 | 558k | ~RangeVector() = default; |
lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::~RangeVector() Line | Count | Source | 145 | 2.13k | ~RangeVector() = default; |
|
146 | | |
147 | | static RangeVector GetOverlaps(const RangeVector &vec1, |
148 | | const RangeVector &vec2) { |
149 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
150 | | assert(vec1.IsSorted() && vec2.IsSorted()); |
151 | | #endif |
152 | | RangeVector result; |
153 | | auto pos1 = vec1.begin(); |
154 | | auto end1 = vec1.end(); |
155 | | auto pos2 = vec2.begin(); |
156 | | auto end2 = vec2.end(); |
157 | | while (pos1 != end1 && pos2 != end2) { |
158 | | Entry entry = pos1->Intersect(*pos2); |
159 | | if (entry.IsValid()) |
160 | | result.Append(entry); |
161 | | if (pos1->GetRangeEnd() < pos2->GetRangeEnd()) |
162 | | ++pos1; |
163 | | else |
164 | | ++pos2; |
165 | | } |
166 | | return result; |
167 | | } |
168 | | |
169 | | bool operator==(const RangeVector &rhs) const { |
170 | | if (GetSize() != rhs.GetSize()) |
171 | | return false; |
172 | | for (size_t i = 0; i < GetSize(); ++i) { |
173 | | if (GetEntryRef(i) != rhs.GetEntryRef(i)) |
174 | | return false; |
175 | | } |
176 | | return true; |
177 | | } |
178 | | |
179 | 2.05M | void Append(const Entry &entry) { m_entries.push_back(entry); } Unexecuted instantiation: lldb_private::RangeVector<unsigned int, unsigned int, 8u>::Append(lldb_private::Range<unsigned int, unsigned int> const&) lldb_private::RangeVector<unsigned int, unsigned int, 0u>::Append(lldb_private::Range<unsigned int, unsigned int> const&) Line | Count | Source | 179 | 28 | void Append(const Entry &entry) { m_entries.push_back(entry); } |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::Append(lldb_private::Range<unsigned int, unsigned int> const&) Line | Count | Source | 179 | 4.12k | void Append(const Entry &entry) { m_entries.push_back(entry); } |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::Append(lldb_private::Range<unsigned long long, unsigned int> const&) Line | Count | Source | 179 | 24.0k | void Append(const Entry &entry) { m_entries.push_back(entry); } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::Append(lldb_private::Range<unsigned long long, unsigned long long> const&) lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::Append(lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 179 | 1.75M | void Append(const Entry &entry) { m_entries.push_back(entry); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::Append(lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 179 | 2.13k | void Append(const Entry &entry) { m_entries.push_back(entry); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::Append(lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 179 | 271k | void Append(const Entry &entry) { m_entries.push_back(entry); } |
|
180 | | |
181 | 1.81k | void Append(B base, S size) { m_entries.emplace_back(base, size); } lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::Append(unsigned long long, unsigned long long) Line | Count | Source | 181 | 1.81k | void Append(B base, S size) { m_entries.emplace_back(base, size); } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::Append(unsigned long long, unsigned long long) |
182 | | |
183 | | // Insert an item into a sorted list and optionally combine it with any |
184 | | // adjacent blocks if requested. |
185 | 63.2k | void Insert(const Entry &entry, bool combine) { |
186 | 63.2k | if (m_entries.empty()) { |
187 | 11.8k | m_entries.push_back(entry); |
188 | 11.8k | return; |
189 | 11.8k | } |
190 | 51.4k | auto begin = m_entries.begin(); |
191 | 51.4k | auto end = m_entries.end(); |
192 | 51.4k | auto pos = std::lower_bound(begin, end, entry); |
193 | 51.4k | if (combine) { |
194 | 22.1k | if (pos != end && pos->Union(entry)) { |
195 | 17.0k | CombinePrevAndNext(pos); |
196 | 17.0k | return; |
197 | 17.0k | } |
198 | 5.08k | if (pos != begin) { |
199 | 2.43k | auto prev = pos - 1; |
200 | 2.43k | if (prev->Union(entry)) { |
201 | 2.38k | CombinePrevAndNext(prev); |
202 | 2.38k | return; |
203 | 2.38k | } |
204 | 2.43k | } |
205 | 5.08k | } |
206 | 32.0k | m_entries.insert(pos, entry); |
207 | 32.0k | } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::Insert(lldb_private::Range<unsigned long long, unsigned int> const&, bool) Line | Count | Source | 185 | 63.2k | void Insert(const Entry &entry, bool combine) { | 186 | 63.2k | if (m_entries.empty()) { | 187 | 11.8k | m_entries.push_back(entry); | 188 | 11.8k | return; | 189 | 11.8k | } | 190 | 51.4k | auto begin = m_entries.begin(); | 191 | 51.4k | auto end = m_entries.end(); | 192 | 51.4k | auto pos = std::lower_bound(begin, end, entry); | 193 | 51.4k | if (combine) { | 194 | 22.1k | if (pos != end && pos->Union(entry)) { | 195 | 17.0k | CombinePrevAndNext(pos); | 196 | 17.0k | return; | 197 | 17.0k | } | 198 | 5.08k | if (pos != begin) { | 199 | 2.43k | auto prev = pos - 1; | 200 | 2.43k | if (prev->Union(entry)) { | 201 | 2.38k | CombinePrevAndNext(prev); | 202 | 2.38k | return; | 203 | 2.38k | } | 204 | 2.43k | } | 205 | 5.08k | } | 206 | 32.0k | m_entries.insert(pos, entry); | 207 | 32.0k | } |
lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::Insert(lldb_private::Range<unsigned long long, unsigned long> const&, bool) Line | Count | Source | 185 | 1 | void Insert(const Entry &entry, bool combine) { | 186 | 1 | if (m_entries.empty()) { | 187 | 1 | m_entries.push_back(entry); | 188 | 1 | return; | 189 | 1 | } | 190 | 0 | auto begin = m_entries.begin(); | 191 | 0 | auto end = m_entries.end(); | 192 | 0 | auto pos = std::lower_bound(begin, end, entry); | 193 | 0 | if (combine) { | 194 | 0 | if (pos != end && pos->Union(entry)) { | 195 | 0 | CombinePrevAndNext(pos); | 196 | 0 | return; | 197 | 0 | } | 198 | 0 | if (pos != begin) { | 199 | 0 | auto prev = pos - 1; | 200 | 0 | if (prev->Union(entry)) { | 201 | 0 | CombinePrevAndNext(prev); | 202 | 0 | return; | 203 | 0 | } | 204 | 0 | } | 205 | 0 | } | 206 | 0 | m_entries.insert(pos, entry); | 207 | 0 | } |
|
208 | | |
209 | 24.2k | bool RemoveEntryAtIndex(uint32_t idx) { |
210 | 24.2k | if (idx < m_entries.size()) { |
211 | 24.2k | m_entries.erase(m_entries.begin() + idx); |
212 | 24.2k | return true; |
213 | 24.2k | } |
214 | 0 | return false; |
215 | 24.2k | } lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::RemoveEntryAtIndex(unsigned int) Line | Count | Source | 209 | 1 | bool RemoveEntryAtIndex(uint32_t idx) { | 210 | 1 | if (idx < m_entries.size()) { | 211 | 1 | m_entries.erase(m_entries.begin() + idx); | 212 | 1 | return true; | 213 | 1 | } | 214 | 0 | return false; | 215 | 1 | } |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::RemoveEntryAtIndex(unsigned int) Line | Count | Source | 209 | 24.2k | bool RemoveEntryAtIndex(uint32_t idx) { | 210 | 24.2k | if (idx < m_entries.size()) { | 211 | 24.2k | m_entries.erase(m_entries.begin() + idx); | 212 | 24.2k | return true; | 213 | 24.2k | } | 214 | 0 | return false; | 215 | 24.2k | } |
|
216 | | |
217 | 118k | void Sort() { |
218 | 118k | if (m_entries.size() > 1) |
219 | 112k | std::stable_sort(m_entries.begin(), m_entries.end()); |
220 | 118k | } lldb_private::RangeVector<unsigned int, unsigned int, 1u>::Sort() Line | Count | Source | 217 | 4.04k | void Sort() { | 218 | 4.04k | if (m_entries.size() > 1) | 219 | 82 | std::stable_sort(m_entries.begin(), m_entries.end()); | 220 | 4.04k | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::Sort() Line | Count | Source | 217 | 111k | void Sort() { | 218 | 111k | if (m_entries.size() > 1) | 219 | 111k | std::stable_sort(m_entries.begin(), m_entries.end()); | 220 | 111k | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::Sort() Line | Count | Source | 217 | 2.13k | void Sort() { | 218 | 2.13k | if (m_entries.size() > 1) | 219 | 4 | std::stable_sort(m_entries.begin(), m_entries.end()); | 220 | 2.13k | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::Sort() Line | Count | Source | 217 | 420 | void Sort() { | 218 | 420 | if (m_entries.size() > 1) | 219 | 415 | std::stable_sort(m_entries.begin(), m_entries.end()); | 220 | 420 | } |
|
221 | | |
222 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
223 | | bool IsSorted() const { |
224 | | typename Collection::const_iterator pos, end, prev; |
225 | | // First we determine if we can combine any of the Entry objects so we |
226 | | // don't end up allocating and making a new collection for no reason |
227 | | for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; |
228 | | prev = pos++) { |
229 | | if (prev != end && *pos < *prev) |
230 | | return false; |
231 | | } |
232 | | return true; |
233 | | } |
234 | | #endif |
235 | | |
236 | 4.04k | void CombineConsecutiveRanges() { |
237 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
238 | | assert(IsSorted()); |
239 | | #endif |
240 | 4.04k | auto first_intersect = std::adjacent_find( |
241 | 4.04k | m_entries.begin(), m_entries.end(), [](const Entry &a, const Entry &b) { |
242 | 86 | return a.DoesAdjoinOrIntersect(b); |
243 | 86 | }); |
244 | 4.04k | if (first_intersect == m_entries.end()) |
245 | 4.03k | return; |
246 | | |
247 | | // We can combine at least one entry, then we make a new collection and |
248 | | // populate it accordingly, and then swap it into place. |
249 | 11 | auto pos = std::next(first_intersect); |
250 | 11 | Collection minimal_ranges(m_entries.begin(), pos); |
251 | 22 | for (; pos != m_entries.end(); ++pos11 ) { |
252 | 11 | Entry &back = minimal_ranges.back(); |
253 | 11 | if (back.DoesAdjoinOrIntersect(*pos)) |
254 | 11 | back.SetRangeEnd(std::max(back.GetRangeEnd(), pos->GetRangeEnd())); |
255 | 0 | else |
256 | 0 | minimal_ranges.push_back(*pos); |
257 | 11 | } |
258 | 11 | m_entries.swap(minimal_ranges); |
259 | 11 | } |
260 | | |
261 | 12.1k | BaseType GetMinRangeBase(BaseType fail_value) const { |
262 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
263 | | assert(IsSorted()); |
264 | | #endif |
265 | 12.1k | if (m_entries.empty()) |
266 | 0 | return fail_value; |
267 | | // m_entries must be sorted, so if we aren't empty, we grab the first |
268 | | // range's base |
269 | 12.1k | return m_entries.front().GetRangeBase(); |
270 | 12.1k | } |
271 | | |
272 | 6.50k | BaseType GetMaxRangeEnd(BaseType fail_value) const { |
273 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
274 | | assert(IsSorted()); |
275 | | #endif |
276 | 6.50k | if (m_entries.empty()) |
277 | 0 | return fail_value; |
278 | | // m_entries must be sorted, so if we aren't empty, we grab the last |
279 | | // range's end |
280 | 6.50k | return m_entries.back().GetRangeEnd(); |
281 | 6.50k | } |
282 | | |
283 | 789 | void Slide(BaseType slide) { |
284 | 789 | typename Collection::iterator pos, end; |
285 | 2.45k | for (pos = m_entries.begin(), end = m_entries.end(); pos != end; ++pos1.66k ) |
286 | 1.66k | pos->Slide(slide); |
287 | 789 | } |
288 | | |
289 | 995 | void Clear() { m_entries.clear(); } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::Clear() Line | Count | Source | 289 | 991 | void Clear() { m_entries.clear(); } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::Clear() lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::Clear() Line | Count | Source | 289 | 3 | void Clear() { m_entries.clear(); } |
lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::Clear() Line | Count | Source | 289 | 1 | void Clear() { m_entries.clear(); } |
|
290 | | |
291 | 1.41k | void Reserve(typename Collection::size_type size) { m_entries.reserve(size); } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::Reserve(unsigned long) Line | Count | Source | 291 | 990 | void Reserve(typename Collection::size_type size) { m_entries.reserve(size); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::Reserve(unsigned long) Line | Count | Source | 291 | 420 | void Reserve(typename Collection::size_type size) { m_entries.reserve(size); } |
|
292 | | |
293 | 558k | bool IsEmpty() const { return m_entries.empty(); } lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::IsEmpty() const Line | Count | Source | 293 | 496k | bool IsEmpty() const { return m_entries.empty(); } |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::IsEmpty() const Line | Count | Source | 293 | 47 | bool IsEmpty() const { return m_entries.empty(); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::IsEmpty() const Line | Count | Source | 293 | 62.1k | bool IsEmpty() const { return m_entries.empty(); } |
lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::IsEmpty() const Line | Count | Source | 293 | 3 | bool IsEmpty() const { return m_entries.empty(); } |
|
294 | | |
295 | 53.8k | size_t GetSize() const { return m_entries.size(); } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::GetSize() const Line | Count | Source | 295 | 49.6k | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeVector<unsigned int, unsigned int, 0u>::GetSize() const Line | Count | Source | 295 | 34 | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::GetSize() const Line | Count | Source | 295 | 104 | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::GetSize() const Line | Count | Source | 295 | 4 | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::GetSize() const Line | Count | Source | 295 | 4.04k | size_t GetSize() const { return m_entries.size(); } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::GetSize() const lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::GetSize() const Line | Count | Source | 295 | 2 | size_t GetSize() const { return m_entries.size(); } |
|
296 | | |
297 | 18.6k | const Entry *GetEntryAtIndex(size_t i) const { |
298 | 18.6k | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); |
299 | 18.6k | } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::GetEntryAtIndex(unsigned long) const Line | Count | Source | 297 | 18.5k | const Entry *GetEntryAtIndex(size_t i) const { | 298 | 18.5k | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 299 | 18.5k | } |
lldb_private::RangeVector<unsigned int, unsigned int, 0u>::GetEntryAtIndex(unsigned long) const Line | Count | Source | 297 | 12 | const Entry *GetEntryAtIndex(size_t i) const { | 298 | 12 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 299 | 12 | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::GetEntryAtIndex(unsigned long) const Line | Count | Source | 297 | 1 | const Entry *GetEntryAtIndex(size_t i) const { | 298 | 1 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 299 | 1 | } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::GetEntryAtIndex(unsigned long) const lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::GetEntryAtIndex(unsigned long) const Line | Count | Source | 297 | 1 | const Entry *GetEntryAtIndex(size_t i) const { | 298 | 1 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 299 | 1 | } |
|
300 | | |
301 | | // Clients must ensure that "i" is a valid index prior to calling this |
302 | | // function |
303 | 82.3k | Entry &GetEntryRef(size_t i) { return m_entries[i]; } lldb_private::RangeVector<unsigned int, unsigned int, 1u>::GetEntryRef(unsigned long) Line | Count | Source | 303 | 40 | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::GetEntryRef(unsigned long) Line | Count | Source | 303 | 78.2k | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 32u>::GetEntryRef(unsigned long) lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::GetEntryRef(unsigned long) Line | Count | Source | 303 | 4.11k | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
|
304 | 87 | const Entry &GetEntryRef(size_t i) const { return m_entries[i]; } lldb_private::RangeVector<unsigned int, unsigned int, 1u>::GetEntryRef(unsigned long) const Line | Count | Source | 304 | 87 | const Entry &GetEntryRef(size_t i) const { return m_entries[i]; } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::GetEntryRef(unsigned long) const |
305 | | |
306 | 0 | Entry *Back() { return (m_entries.empty() ? nullptr : &m_entries.back()); } |
307 | | |
308 | | const Entry *Back() const { |
309 | | return (m_entries.empty() ? nullptr : &m_entries.back()); |
310 | | } |
311 | | |
312 | 167M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { |
313 | 167M | return lhs.GetRangeBase() < rhs.GetRangeBase(); |
314 | 167M | } Unexecuted instantiation: lldb_private::RangeVector<unsigned int, unsigned int, 8u>::BaseLessThan(lldb_private::Range<unsigned int, unsigned int> const&, lldb_private::Range<unsigned int, unsigned int> const&) lldb_private::RangeVector<unsigned int, unsigned int, 1u>::BaseLessThan(lldb_private::Range<unsigned int, unsigned int> const&, lldb_private::Range<unsigned int, unsigned int> const&) Line | Count | Source | 312 | 1.06k | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 313 | 1.06k | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 314 | 1.06k | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::BaseLessThan(lldb_private::Range<unsigned long long, unsigned long long> const&, lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 312 | 166M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 313 | 166M | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 314 | 166M | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::BaseLessThan(lldb_private::Range<unsigned long long, unsigned long long> const&, lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 312 | 1.17M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 313 | 1.17M | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 314 | 1.17M | } |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::BaseLessThan(lldb_private::Range<unsigned long long, unsigned int> const&, lldb_private::Range<unsigned long long, unsigned int> const&) Line | Count | Source | 312 | 67.2k | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 313 | 67.2k | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 314 | 67.2k | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::BaseLessThan(lldb_private::Range<unsigned long long, unsigned long long> const&, lldb_private::Range<unsigned long long, unsigned long long> const&) Line | Count | Source | 312 | 203k | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 313 | 203k | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 314 | 203k | } |
|
315 | | |
316 | 23.0k | uint32_t FindEntryIndexThatContains(B addr) const { |
317 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
318 | | assert(IsSorted()); |
319 | | #endif |
320 | 23.0k | if (!m_entries.empty()) { |
321 | 23.0k | Entry entry(addr, 1); |
322 | 23.0k | typename Collection::const_iterator begin = m_entries.begin(); |
323 | 23.0k | typename Collection::const_iterator end = m_entries.end(); |
324 | 23.0k | typename Collection::const_iterator pos = |
325 | 23.0k | std::lower_bound(begin, end, entry, BaseLessThan); |
326 | | |
327 | 23.0k | if (pos != end && pos->Contains(addr)23.0k ) { |
328 | 23.0k | return std::distance(begin, pos); |
329 | 23.0k | } else if (8 pos != begin8 ) { |
330 | 8 | --pos; |
331 | 8 | if (pos->Contains(addr)) |
332 | 8 | return std::distance(begin, pos); |
333 | 8 | } |
334 | 23.0k | } |
335 | 0 | return UINT32_MAX; |
336 | 23.0k | } lldb_private::RangeVector<unsigned int, unsigned int, 1u>::FindEntryIndexThatContains(unsigned int) const Line | Count | Source | 316 | 8 | uint32_t FindEntryIndexThatContains(B addr) const { | 317 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 318 | | assert(IsSorted()); | 319 | | #endif | 320 | 8 | if (!m_entries.empty()) { | 321 | 8 | Entry entry(addr, 1); | 322 | 8 | typename Collection::const_iterator begin = m_entries.begin(); | 323 | 8 | typename Collection::const_iterator end = m_entries.end(); | 324 | 8 | typename Collection::const_iterator pos = | 325 | 8 | std::lower_bound(begin, end, entry, BaseLessThan); | 326 | | | 327 | 8 | if (pos != end && pos->Contains(addr)0 ) { | 328 | 0 | return std::distance(begin, pos); | 329 | 8 | } else if (pos != begin) { | 330 | 8 | --pos; | 331 | 8 | if (pos->Contains(addr)) | 332 | 8 | return std::distance(begin, pos); | 333 | 8 | } | 334 | 8 | } | 335 | 0 | return UINT32_MAX; | 336 | 8 | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::FindEntryIndexThatContains(unsigned long long) const Line | Count | Source | 316 | 1 | uint32_t FindEntryIndexThatContains(B addr) const { | 317 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 318 | | assert(IsSorted()); | 319 | | #endif | 320 | 1 | if (!m_entries.empty()) { | 321 | 1 | Entry entry(addr, 1); | 322 | 1 | typename Collection::const_iterator begin = m_entries.begin(); | 323 | 1 | typename Collection::const_iterator end = m_entries.end(); | 324 | 1 | typename Collection::const_iterator pos = | 325 | 1 | std::lower_bound(begin, end, entry, BaseLessThan); | 326 | | | 327 | 1 | if (pos != end && pos->Contains(addr)) { | 328 | 1 | return std::distance(begin, pos); | 329 | 1 | } else if (0 pos != begin0 ) { | 330 | 0 | --pos; | 331 | 0 | if (pos->Contains(addr)) | 332 | 0 | return std::distance(begin, pos); | 333 | 0 | } | 334 | 1 | } | 335 | 0 | return UINT32_MAX; | 336 | 1 | } |
lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::FindEntryIndexThatContains(unsigned long long) const Line | Count | Source | 316 | 23.0k | uint32_t FindEntryIndexThatContains(B addr) const { | 317 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 318 | | assert(IsSorted()); | 319 | | #endif | 320 | 23.0k | if (!m_entries.empty()) { | 321 | 23.0k | Entry entry(addr, 1); | 322 | 23.0k | typename Collection::const_iterator begin = m_entries.begin(); | 323 | 23.0k | typename Collection::const_iterator end = m_entries.end(); | 324 | 23.0k | typename Collection::const_iterator pos = | 325 | 23.0k | std::lower_bound(begin, end, entry, BaseLessThan); | 326 | | | 327 | 23.0k | if (pos != end && pos->Contains(addr)) { | 328 | 23.0k | return std::distance(begin, pos); | 329 | 23.0k | } else if (0 pos != begin0 ) { | 330 | 0 | --pos; | 331 | 0 | if (pos->Contains(addr)) | 332 | 0 | return std::distance(begin, pos); | 333 | 0 | } | 334 | 23.0k | } | 335 | 0 | return UINT32_MAX; | 336 | 23.0k | } |
|
337 | | |
338 | 38.5M | const Entry *FindEntryThatContains(B addr) const { |
339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
340 | | assert(IsSorted()); |
341 | | #endif |
342 | 38.5M | if (!m_entries.empty()) { |
343 | 36.8M | Entry entry(addr, 1); |
344 | 36.8M | typename Collection::const_iterator begin = m_entries.begin(); |
345 | 36.8M | typename Collection::const_iterator end = m_entries.end(); |
346 | 36.8M | typename Collection::const_iterator pos = |
347 | 36.8M | std::lower_bound(begin, end, entry, BaseLessThan); |
348 | | |
349 | 36.8M | if (pos != end && pos->Contains(addr)35.4M ) { |
350 | 510k | return &(*pos); |
351 | 36.3M | } else if (pos != begin) { |
352 | 36.3M | --pos; |
353 | 36.3M | if (pos->Contains(addr)) { |
354 | 35.1M | return &(*pos); |
355 | 35.1M | } |
356 | 36.3M | } |
357 | 36.8M | } |
358 | 2.91M | return nullptr; |
359 | 38.5M | } lldb_private::RangeVector<unsigned int, unsigned int, 8u>::FindEntryThatContains(unsigned int) const Line | Count | Source | 338 | 1.64M | const Entry *FindEntryThatContains(B addr) const { | 339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 340 | | assert(IsSorted()); | 341 | | #endif | 342 | 1.64M | if (!m_entries.empty()) { | 343 | 0 | Entry entry(addr, 1); | 344 | 0 | typename Collection::const_iterator begin = m_entries.begin(); | 345 | 0 | typename Collection::const_iterator end = m_entries.end(); | 346 | 0 | typename Collection::const_iterator pos = | 347 | 0 | std::lower_bound(begin, end, entry, BaseLessThan); | 348 | |
| 349 | 0 | if (pos != end && pos->Contains(addr)) { | 350 | 0 | return &(*pos); | 351 | 0 | } else if (pos != begin) { | 352 | 0 | --pos; | 353 | 0 | if (pos->Contains(addr)) { | 354 | 0 | return &(*pos); | 355 | 0 | } | 356 | 0 | } | 357 | 0 | } | 358 | 1.64M | return nullptr; | 359 | 1.64M | } |
lldb_private::RangeVector<unsigned int, unsigned int, 1u>::FindEntryThatContains(unsigned int) const Line | Count | Source | 338 | 293 | const Entry *FindEntryThatContains(B addr) const { | 339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 340 | | assert(IsSorted()); | 341 | | #endif | 342 | 293 | if (!m_entries.empty()) { | 343 | 293 | Entry entry(addr, 1); | 344 | 293 | typename Collection::const_iterator begin = m_entries.begin(); | 345 | 293 | typename Collection::const_iterator end = m_entries.end(); | 346 | 293 | typename Collection::const_iterator pos = | 347 | 293 | std::lower_bound(begin, end, entry, BaseLessThan); | 348 | | | 349 | 293 | if (pos != end && pos->Contains(addr)115 ) { | 350 | 113 | return &(*pos); | 351 | 180 | } else if (pos != begin) { | 352 | 180 | --pos; | 353 | 180 | if (pos->Contains(addr)) { | 354 | 174 | return &(*pos); | 355 | 174 | } | 356 | 180 | } | 357 | 293 | } | 358 | 6 | return nullptr; | 359 | 293 | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::FindEntryThatContains(unsigned long long) const Line | Count | Source | 338 | 35.4M | const Entry *FindEntryThatContains(B addr) const { | 339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 340 | | assert(IsSorted()); | 341 | | #endif | 342 | 35.4M | if (!m_entries.empty()) { | 343 | 35.4M | Entry entry(addr, 1); | 344 | 35.4M | typename Collection::const_iterator begin = m_entries.begin(); | 345 | 35.4M | typename Collection::const_iterator end = m_entries.end(); | 346 | 35.4M | typename Collection::const_iterator pos = | 347 | 35.4M | std::lower_bound(begin, end, entry, BaseLessThan); | 348 | | | 349 | 35.4M | if (pos != end && pos->Contains(addr)35.4M ) { | 350 | 505k | return &(*pos); | 351 | 34.9M | } else if (pos != begin) { | 352 | 34.9M | --pos; | 353 | 34.9M | if (pos->Contains(addr)) { | 354 | 34.9M | return &(*pos); | 355 | 34.9M | } | 356 | 34.9M | } | 357 | 35.4M | } | 358 | 2.75k | return nullptr; | 359 | 35.4M | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 4u>::FindEntryThatContains(unsigned long long) const Line | Count | Source | 338 | 1.26M | const Entry *FindEntryThatContains(B addr) const { | 339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 340 | | assert(IsSorted()); | 341 | | #endif | 342 | 1.26M | if (!m_entries.empty()) { | 343 | 1.17M | Entry entry(addr, 1); | 344 | 1.17M | typename Collection::const_iterator begin = m_entries.begin(); | 345 | 1.17M | typename Collection::const_iterator end = m_entries.end(); | 346 | 1.17M | typename Collection::const_iterator pos = | 347 | 1.17M | std::lower_bound(begin, end, entry, BaseLessThan); | 348 | | | 349 | 1.17M | if (pos != end && pos->Contains(addr)697 ) { | 350 | 697 | return &(*pos); | 351 | 1.16M | } else if (pos != begin) { | 352 | 1.16M | --pos; | 353 | 1.16M | if (pos->Contains(addr)) { | 354 | 16 | return &(*pos); | 355 | 16 | } | 356 | 1.16M | } | 357 | 1.17M | } | 358 | 1.26M | return nullptr; | 359 | 1.26M | } |
lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::FindEntryThatContains(unsigned long long) const Line | Count | Source | 338 | 203k | const Entry *FindEntryThatContains(B addr) const { | 339 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 340 | | assert(IsSorted()); | 341 | | #endif | 342 | 203k | if (!m_entries.empty()) { | 343 | 202k | Entry entry(addr, 1); | 344 | 202k | typename Collection::const_iterator begin = m_entries.begin(); | 345 | 202k | typename Collection::const_iterator end = m_entries.end(); | 346 | 202k | typename Collection::const_iterator pos = | 347 | 202k | std::lower_bound(begin, end, entry, BaseLessThan); | 348 | | | 349 | 202k | if (pos != end && pos->Contains(addr)6.15k ) { | 350 | 4.45k | return &(*pos); | 351 | 198k | } else if (pos != begin) { | 352 | 196k | --pos; | 353 | 196k | if (pos->Contains(addr)) { | 354 | 194k | return &(*pos); | 355 | 194k | } | 356 | 196k | } | 357 | 202k | } | 358 | 4.85k | return nullptr; | 359 | 203k | } |
|
360 | | |
361 | 759 | const Entry *FindEntryThatContains(const Entry &range) const { |
362 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
363 | | assert(IsSorted()); |
364 | | #endif |
365 | 759 | if (!m_entries.empty()) { |
366 | 759 | typename Collection::const_iterator begin = m_entries.begin(); |
367 | 759 | typename Collection::const_iterator end = m_entries.end(); |
368 | 759 | typename Collection::const_iterator pos = |
369 | 759 | std::lower_bound(begin, end, range, BaseLessThan); |
370 | | |
371 | 759 | if (pos != end && pos->Contains(range)13 ) { |
372 | 13 | return &(*pos); |
373 | 746 | } else if (pos != begin) { |
374 | 746 | --pos; |
375 | 746 | if (pos->Contains(range)) { |
376 | 746 | return &(*pos); |
377 | 746 | } |
378 | 746 | } |
379 | 759 | } |
380 | 0 | return nullptr; |
381 | 759 | } |
382 | | |
383 | | using const_iterator = typename Collection::const_iterator; |
384 | 321k | const_iterator begin() const { return m_entries.begin(); } Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::begin() const lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::begin() const Line | Count | Source | 384 | 321k | const_iterator begin() const { return m_entries.begin(); } |
|
385 | 321k | const_iterator end() const { return m_entries.end(); } Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long long, 0u>::end() const lldb_private::RangeVector<unsigned long long, unsigned long long, 2u>::end() const Line | Count | Source | 385 | 321k | const_iterator end() const { return m_entries.end(); } |
|
386 | | |
387 | | protected: |
388 | 19.4k | void CombinePrevAndNext(typename Collection::iterator pos) { |
389 | | // Check if the prev or next entries in case they need to be unioned with |
390 | | // the entry pointed to by "pos". |
391 | 19.4k | if (pos != m_entries.begin()) { |
392 | 1.74k | auto prev = pos - 1; |
393 | 1.74k | if (prev->Union(*pos)) |
394 | 1.62k | m_entries.erase(pos); |
395 | 1.74k | pos = prev; |
396 | 1.74k | } |
397 | | |
398 | 19.4k | auto end = m_entries.end(); |
399 | 19.4k | if (pos != end) { |
400 | 19.4k | auto next = pos + 1; |
401 | 19.4k | if (next != end) { |
402 | 9.85k | if (pos->Union(*next)) |
403 | 0 | m_entries.erase(next); |
404 | 9.85k | } |
405 | 19.4k | } |
406 | 19.4k | } lldb_private::RangeVector<unsigned long long, unsigned int, 0u>::CombinePrevAndNext(lldb_private::Range<unsigned long long, unsigned int>*) Line | Count | Source | 388 | 19.4k | void CombinePrevAndNext(typename Collection::iterator pos) { | 389 | | // Check if the prev or next entries in case they need to be unioned with | 390 | | // the entry pointed to by "pos". | 391 | 19.4k | if (pos != m_entries.begin()) { | 392 | 1.74k | auto prev = pos - 1; | 393 | 1.74k | if (prev->Union(*pos)) | 394 | 1.62k | m_entries.erase(pos); | 395 | 1.74k | pos = prev; | 396 | 1.74k | } | 397 | | | 398 | 19.4k | auto end = m_entries.end(); | 399 | 19.4k | if (pos != end) { | 400 | 19.4k | auto next = pos + 1; | 401 | 19.4k | if (next != end) { | 402 | 9.85k | if (pos->Union(*next)) | 403 | 0 | m_entries.erase(next); | 404 | 9.85k | } | 405 | 19.4k | } | 406 | 19.4k | } |
Unexecuted instantiation: lldb_private::RangeVector<unsigned long long, unsigned long, 0u>::CombinePrevAndNext(lldb_private::Range<unsigned long long, unsigned long>*) |
407 | | |
408 | | Collection m_entries; |
409 | | }; |
410 | | |
411 | | // A simple range with data class where you get to define the type of |
412 | | // the range base "B", the type used for the range byte size "S", and the type |
413 | | // for the associated data "T". |
414 | | template <typename B, typename S, typename T> |
415 | | struct RangeData : public Range<B, S> { |
416 | | typedef T DataType; |
417 | | |
418 | | DataType data; |
419 | | |
420 | 120k | RangeData() : Range<B, S>(), data() {} lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long>::RangeData() Line | Count | Source | 420 | 8.48k | RangeData() : Range<B, S>(), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int>::RangeData() Line | Count | Source | 420 | 112k | RangeData() : Range<B, S>(), data() {} |
|
421 | | |
422 | 4.51M | RangeData(B base, S size) : Range<B, S>(base, size), data()368k {} lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long>::RangeData(unsigned long long, unsigned int) Line | Count | Source | 422 | 1.51M | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 27.5k | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 2.60M | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 341 | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 3 | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 75.7k | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations>::RangeData(unsigned long long, unsigned long long) Unexecuted instantiation: lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> >::RangeData(unsigned long long, unsigned int) Unexecuted instantiation: lldb_private::RangeData<unsigned int, unsigned int, int>::RangeData(unsigned int, unsigned int) lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> >::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 291k | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 86 | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark>::RangeData(unsigned long long, unsigned long long) Line | Count | Source | 422 | 57 | RangeData(B base, S size) : Range<B, S>(base, size), data() {} |
|
423 | | |
424 | 341k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(65.6k d275k ) {} lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long>::RangeData(unsigned long long, unsigned int, unsigned long long) Line | Count | Source | 424 | 253k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression>::RangeData(unsigned long long, unsigned long long, lldb_private::DWARFExpression) Line | Count | Source | 424 | 25.2k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*>::RangeData(unsigned long long, unsigned long long, lldb_private::Variable*) Line | Count | Source | 424 | 1 | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry>::RangeData(unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry) Line | Count | Source | 424 | 38.8k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long>::RangeData(unsigned long long, unsigned long long, unsigned long long) Line | Count | Source | 424 | 20.2k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations>::RangeData(unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations) Unexecuted instantiation: lldb_private::RangeData<unsigned int, unsigned int, int>::RangeData(unsigned int, unsigned int, int) lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> >::RangeData(unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>) Line | Count | Source | 424 | 1.53k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int>::RangeData(unsigned long long, unsigned long long, unsigned int) Line | Count | Source | 424 | 1.53k | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData>::RangeData(unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData) Line | Count | Source | 424 | 40 | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark>::RangeData(unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark) Line | Count | Source | 424 | 29 | RangeData(B base, S size, DataType d) : Range<B, S>(base, size), data(d) {} |
|
425 | | }; |
426 | | |
427 | | // We can treat the vector as a flattened Binary Search Tree, augmenting it |
428 | | // with upper bounds (max of range endpoints) for every index allows us to |
429 | | // query for range containment quicker. |
430 | | template <typename B, typename S, typename T> |
431 | | struct AugmentedRangeData : public RangeData<B, S, T> { |
432 | | B upper_bound; |
433 | | |
434 | | AugmentedRangeData(const RangeData<B, S, T> &rd) |
435 | 131M | : RangeData<B, S, T>(rd), upper_bound() {} lldb_private::AugmentedRangeData<unsigned long long, unsigned int, unsigned long long>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&) Line | Count | Source | 435 | 253k | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, unsigned int>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) Line | Count | Source | 435 | 130M | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&) Line | Count | Source | 435 | 25.2k | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, lldb_private::Variable*>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&) Line | Count | Source | 435 | 1 | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&) Line | Count | Source | 435 | 38.8k | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, unsigned long long>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&) Line | Count | Source | 435 | 20.2k | : RangeData<B, S, T>(rd), upper_bound() {} |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&) Unexecuted instantiation: lldb_private::AugmentedRangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> >::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&) Unexecuted instantiation: lldb_private::AugmentedRangeData<unsigned int, unsigned int, int>::AugmentedRangeData(lldb_private::RangeData<unsigned int, unsigned int, int> const&) lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> >::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&) Line | Count | Source | 435 | 575 | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&) Line | Count | Source | 435 | 40 | : RangeData<B, S, T>(rd), upper_bound() {} |
lldb_private::AugmentedRangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark>::AugmentedRangeData(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&) Line | Count | Source | 435 | 29 | : RangeData<B, S, T>(rd), upper_bound() {} |
|
436 | | }; |
437 | | |
438 | | template <typename B, typename S, typename T, unsigned N = 0, |
439 | | class Compare = std::less<T>> |
440 | | class RangeDataVector { |
441 | | public: |
442 | | typedef lldb_private::Range<B, S> Range; |
443 | | typedef RangeData<B, S, T> Entry; |
444 | | typedef AugmentedRangeData<B, S, T> AugmentedEntry; |
445 | | typedef llvm::SmallVector<AugmentedEntry, N> Collection; |
446 | | |
447 | 275k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::RangeDataVector(std::__1::less<unsigned long long>) Line | Count | Source | 447 | 9.62k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::RangeDataVector(lldb_private::DWARFExpressionList::DWARFExpressionCompare) Line | Count | Source | 447 | 37.9k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::RangeDataVector(lldb_private::Symtab::FileRangeToIndexMapCompare) Line | Count | Source | 447 | 116k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::RangeDataVector(std::__1::less<lldb_private::Variable*>) Line | Count | Source | 447 | 2 | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::RangeDataVector(std::__1::less<SymbolFileDWARFDebugMap::OSOEntry>) Line | Count | Source | 447 | 109k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::RangeDataVector(std::__1::less<unsigned long long>) Line | Count | Source | 447 | 1.33k | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::RangeDataVector(std::__1::less<std::__1::pair<unsigned int, unsigned int> >) Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::RangeDataVector((anonymous namespace)::MemberLocations::Comparator) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::RangeDataVector(std::__1::less<int>) lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::RangeDataVector(std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> >) Line | Count | Source | 447 | 140 | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::RangeDataVector(std::__1::less<unsigned int>) Line | Count | Source | 447 | 76 | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::RangeDataVector(std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData>) Line | Count | Source | 447 | 24 | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::RangeDataVector(std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark>) Line | Count | Source | 447 | 12 | RangeDataVector(Compare compare = Compare()) : m_compare(compare) {} |
|
448 | | |
449 | 288k | ~RangeDataVector() = default; lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::~RangeDataVector() Line | Count | Source | 449 | 9.26k | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::~RangeDataVector() Line | Count | Source | 449 | 56.1k | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::~RangeDataVector() Line | Count | Source | 449 | 111k | ~RangeDataVector() = default; |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::~RangeDataVector() lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::~RangeDataVector() Line | Count | Source | 449 | 109k | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::~RangeDataVector() Line | Count | Source | 449 | 1.14k | ~RangeDataVector() = default; |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::~RangeDataVector() Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::~RangeDataVector() Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::~RangeDataVector() lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::~RangeDataVector() Line | Count | Source | 449 | 140 | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::~RangeDataVector() Line | Count | Source | 449 | 76 | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::~RangeDataVector() Line | Count | Source | 449 | 10 | ~RangeDataVector() = default; |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::~RangeDataVector() Line | Count | Source | 449 | 14 | ~RangeDataVector() = default; |
|
450 | | |
451 | 131M | void Append(const Entry &entry) { m_entries.emplace_back(entry); } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::Append(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&) Line | Count | Source | 451 | 253k | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::Append(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) Line | Count | Source | 451 | 130M | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::Append(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&) Line | Count | Source | 451 | 25.2k | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&) Line | Count | Source | 451 | 1 | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&) Line | Count | Source | 451 | 38.8k | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&) Line | Count | Source | 451 | 20.2k | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::Append(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::Append(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::Append(lldb_private::RangeData<unsigned int, unsigned int, int> const&) lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&) Line | Count | Source | 451 | 575 | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) Line | Count | Source | 451 | 1.53k | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&) Line | Count | Source | 451 | 40 | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::Append(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&) Line | Count | Source | 451 | 29 | void Append(const Entry &entry) { m_entries.emplace_back(entry); } |
|
452 | | |
453 | 0 | bool Erase(uint32_t start, uint32_t end) { |
454 | 0 | if (start >= end || end > m_entries.size()) |
455 | 0 | return false; |
456 | 0 | m_entries.erase(begin() + start, begin() + end); |
457 | 0 | return true; |
458 | 0 | } |
459 | | |
460 | 234k | void Sort() { |
461 | 234k | if (m_entries.size() > 1) |
462 | 231k | std::stable_sort(m_entries.begin(), m_entries.end(), |
463 | 1.73G | [&compare = m_compare](const Entry &a, const Entry &b) { |
464 | 1.73G | if (a.base != b.base) |
465 | 1.73G | return a.base < b.base; |
466 | 5.68M | if (a.size != b.size) |
467 | 2.09k | return a.size < b.size; |
468 | 5.68M | return compare(a.data, b.data); |
469 | 5.68M | }); lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&) const Line | Count | Source | 463 | 1.51M | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 1.51M | if (a.base != b.base) | 465 | 1.51M | return a.base < b.base; | 466 | 1 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 1 | return compare(a.data, b.data); | 469 | 1 | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) const Line | Count | Source | 463 | 1.73G | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 1.73G | if (a.base != b.base) | 465 | 1.72G | return a.base < b.base; | 466 | 5.68M | if (a.size != b.size) | 467 | 2.09k | return a.size < b.size; | 468 | 5.68M | return compare(a.data, b.data); | 469 | 5.68M | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&) const Line | Count | Source | 463 | 143 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 143 | if (a.base != b.base) | 465 | 143 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&, lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&, lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&) const Line | Count | Source | 463 | 101k | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 101k | if (a.base != b.base) | 465 | 101k | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&) const Line | Count | Source | 463 | 35.4k | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 35.4k | if (a.base != b.base) | 465 | 35.4k | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&, lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&, lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&, lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&, lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::Sort()::'lambda'(lldb_private::RangeData<unsigned int, unsigned int, int> const&, lldb_private::RangeData<unsigned int, unsigned int, int> const&)::operator()(lldb_private::RangeData<unsigned int, unsigned int, int> const&, lldb_private::RangeData<unsigned int, unsigned int, int> const&) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&) const Line | Count | Source | 463 | 6 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 6 | if (a.base != b.base) | 465 | 6 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) const Line | Count | Source | 463 | 6 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 6 | if (a.base != b.base) | 465 | 6 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&) const Line | Count | Source | 463 | 26 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 26 | if (a.base != b.base) | 465 | 26 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::Sort()::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&) const Line | Count | Source | 463 | 23 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 23 | if (a.base != b.base) | 465 | 23 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); |
|
470 | 234k | if (!m_entries.empty()) |
471 | 234k | ComputeUpperBounds(0, m_entries.size()); |
472 | 234k | } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::Sort() Line | Count | Source | 460 | 147 | void Sort() { | 461 | 147 | if (m_entries.size() > 1) | 462 | 112 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 112 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 112 | if (a.base != b.base) | 465 | 112 | return a.base < b.base; | 466 | 112 | if (a.size != b.size) | 467 | 112 | return a.size < b.size; | 468 | 112 | return compare(a.data, b.data); | 469 | 112 | }); | 470 | 147 | if (!m_entries.empty()) | 471 | 143 | ComputeUpperBounds(0, m_entries.size()); | 472 | 147 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::Sort() Line | Count | Source | 460 | 9.43k | void Sort() { | 461 | 9.43k | if (m_entries.size() > 1) | 462 | 7.15k | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 7.15k | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 7.15k | if (a.base != b.base) | 465 | 7.15k | return a.base < b.base; | 466 | 7.15k | if (a.size != b.size) | 467 | 7.15k | return a.size < b.size; | 468 | 7.15k | return compare(a.data, b.data); | 469 | 7.15k | }); | 470 | 9.43k | if (!m_entries.empty()) | 471 | 9.43k | ComputeUpperBounds(0, m_entries.size()); | 472 | 9.43k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::Sort() Line | Count | Source | 460 | 223k | void Sort() { | 461 | 223k | if (m_entries.size() > 1) | 462 | 223k | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 223k | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 223k | if (a.base != b.base) | 465 | 223k | return a.base < b.base; | 466 | 223k | if (a.size != b.size) | 467 | 223k | return a.size < b.size; | 468 | 223k | return compare(a.data, b.data); | 469 | 223k | }); | 470 | 223k | if (!m_entries.empty()) | 471 | 223k | ComputeUpperBounds(0, m_entries.size()); | 472 | 223k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::Sort() Line | Count | Source | 460 | 2 | void Sort() { | 461 | 2 | if (m_entries.size() > 1) | 462 | 0 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 0 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 0 | if (a.base != b.base) | 465 | 0 | return a.base < b.base; | 466 | 0 | if (a.size != b.size) | 467 | 0 | return a.size < b.size; | 468 | 0 | return compare(a.data, b.data); | 469 | 0 | }); | 470 | 2 | if (!m_entries.empty()) | 471 | 1 | ComputeUpperBounds(0, m_entries.size()); | 472 | 2 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::Sort() Line | Count | Source | 460 | 876 | void Sort() { | 461 | 876 | if (m_entries.size() > 1) | 462 | 694 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 694 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 694 | if (a.base != b.base) | 465 | 694 | return a.base < b.base; | 466 | 694 | if (a.size != b.size) | 467 | 694 | return a.size < b.size; | 468 | 694 | return compare(a.data, b.data); | 469 | 694 | }); | 470 | 876 | if (!m_entries.empty()) | 471 | 875 | ComputeUpperBounds(0, m_entries.size()); | 472 | 876 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::Sort() Line | Count | Source | 460 | 858 | void Sort() { | 461 | 858 | if (m_entries.size() > 1) | 462 | 659 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 659 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 659 | if (a.base != b.base) | 465 | 659 | return a.base < b.base; | 466 | 659 | if (a.size != b.size) | 467 | 659 | return a.size < b.size; | 468 | 659 | return compare(a.data, b.data); | 469 | 659 | }); | 470 | 858 | if (!m_entries.empty()) | 471 | 858 | ComputeUpperBounds(0, m_entries.size()); | 472 | 858 | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::Sort() Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::Sort() Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::Sort() lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::Sort() Line | Count | Source | 460 | 2 | void Sort() { | 461 | 2 | if (m_entries.size() > 1) | 462 | 2 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 2 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 2 | if (a.base != b.base) | 465 | 2 | return a.base < b.base; | 466 | 2 | if (a.size != b.size) | 467 | 2 | return a.size < b.size; | 468 | 2 | return compare(a.data, b.data); | 469 | 2 | }); | 470 | 2 | if (!m_entries.empty()) | 471 | 2 | ComputeUpperBounds(0, m_entries.size()); | 472 | 2 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::Sort() Line | Count | Source | 460 | 2 | void Sort() { | 461 | 2 | if (m_entries.size() > 1) | 462 | 2 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 2 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 2 | if (a.base != b.base) | 465 | 2 | return a.base < b.base; | 466 | 2 | if (a.size != b.size) | 467 | 2 | return a.size < b.size; | 468 | 2 | return compare(a.data, b.data); | 469 | 2 | }); | 470 | 2 | if (!m_entries.empty()) | 471 | 2 | ComputeUpperBounds(0, m_entries.size()); | 472 | 2 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::Sort() Line | Count | Source | 460 | 24 | void Sort() { | 461 | 24 | if (m_entries.size() > 1) | 462 | 13 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 13 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 13 | if (a.base != b.base) | 465 | 13 | return a.base < b.base; | 466 | 13 | if (a.size != b.size) | 467 | 13 | return a.size < b.size; | 468 | 13 | return compare(a.data, b.data); | 469 | 13 | }); | 470 | 24 | if (!m_entries.empty()) | 471 | 18 | ComputeUpperBounds(0, m_entries.size()); | 472 | 24 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::Sort() Line | Count | Source | 460 | 12 | void Sort() { | 461 | 12 | if (m_entries.size() > 1) | 462 | 4 | std::stable_sort(m_entries.begin(), m_entries.end(), | 463 | 4 | [&compare = m_compare](const Entry &a, const Entry &b) { | 464 | 4 | if (a.base != b.base) | 465 | 4 | return a.base < b.base; | 466 | 4 | if (a.size != b.size) | 467 | 4 | return a.size < b.size; | 468 | 4 | return compare(a.data, b.data); | 469 | 4 | }); | 470 | 12 | if (!m_entries.empty()) | 471 | 6 | ComputeUpperBounds(0, m_entries.size()); | 472 | 12 | } |
|
473 | | |
474 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
475 | | bool IsSorted() const { |
476 | | typename Collection::const_iterator pos, end, prev; |
477 | | for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; |
478 | | prev = pos++) { |
479 | | if (prev != end && *pos < *prev) |
480 | | return false; |
481 | | } |
482 | | return true; |
483 | | } |
484 | | #endif |
485 | | |
486 | 4.27k | void CombineConsecutiveEntriesWithEqualData() { |
487 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
488 | | assert(IsSorted()); |
489 | | #endif |
490 | 4.27k | typename Collection::iterator pos; |
491 | 4.27k | typename Collection::iterator end; |
492 | 4.27k | typename Collection::iterator prev; |
493 | 4.27k | bool can_combine = false; |
494 | | // First we determine if we can combine any of the Entry objects so we |
495 | | // don't end up allocating and making a new collection for no reason |
496 | 55.9k | for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; |
497 | 52.6k | prev = pos++51.6k ) { |
498 | 52.6k | if (prev != end && prev->data == pos->data48.3k ) { |
499 | 921 | can_combine = true; |
500 | 921 | break; |
501 | 921 | } |
502 | 52.6k | } |
503 | | |
504 | | // We can combine at least one entry, then we make a new collection and |
505 | | // populate it accordingly, and then swap it into place. |
506 | 4.27k | if (can_combine) { |
507 | 921 | Collection minimal_ranges; |
508 | 921 | for (pos = m_entries.begin(), end = m_entries.end(), prev = end; |
509 | 32.4k | pos != end; prev = pos++31.5k ) { |
510 | 31.5k | if (prev != end && prev->data == pos->data30.6k ) |
511 | 30.5k | minimal_ranges.back().SetRangeEnd(pos->GetRangeEnd()); |
512 | 1.00k | else |
513 | 1.00k | minimal_ranges.push_back(*pos); |
514 | 31.5k | } |
515 | | // Use the swap technique in case our new vector is much smaller. We must |
516 | | // swap when using the STL because std::vector objects never release or |
517 | | // reduce the memory once it has been allocated/reserved. |
518 | 921 | m_entries.swap(minimal_ranges); |
519 | 921 | } |
520 | 4.27k | } |
521 | | |
522 | 7.50k | void Clear() { m_entries.clear(); } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::Clear() Line | Count | Source | 522 | 147 | void Clear() { m_entries.clear(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::Clear() Line | Count | Source | 522 | 1 | void Clear() { m_entries.clear(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::Clear() Line | Count | Source | 522 | 7.35k | void Clear() { m_entries.clear(); } |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::Clear() |
523 | | |
524 | 772k | bool IsEmpty() const { return m_entries.empty(); } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::IsEmpty() const Line | Count | Source | 524 | 21.7k | bool IsEmpty() const { return m_entries.empty(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::IsEmpty() const Line | Count | Source | 524 | 750k | bool IsEmpty() const { return m_entries.empty(); } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::IsEmpty() const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::IsEmpty() const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::IsEmpty() const Line | Count | Source | 524 | 26 | bool IsEmpty() const { return m_entries.empty(); } |
|
525 | | |
526 | 317k | size_t GetSize() const { return m_entries.size(); } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::GetSize() const Line | Count | Source | 526 | 169k | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::GetSize() const Line | Count | Source | 526 | 36.0k | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::GetSize() const Line | Count | Source | 526 | 112k | size_t GetSize() const { return m_entries.size(); } |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::GetSize() const Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::GetSize() const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::GetSize() const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::GetSize() const Line | Count | Source | 526 | 3 | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::GetSize() const Line | Count | Source | 526 | 12 | size_t GetSize() const { return m_entries.size(); } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::GetSize() const Line | Count | Source | 526 | 62 | size_t GetSize() const { return m_entries.size(); } |
|
527 | | |
528 | 194k | const Entry *GetEntryAtIndex(size_t i) const { |
529 | 194k | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); |
530 | 194k | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::GetEntryAtIndex(unsigned long) const Line | Count | Source | 528 | 50.3k | const Entry *GetEntryAtIndex(size_t i) const { | 529 | 50.3k | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 530 | 50.3k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::GetEntryAtIndex(unsigned long) const Line | Count | Source | 528 | 143k | const Entry *GetEntryAtIndex(size_t i) const { | 529 | 143k | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 530 | 143k | } |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::GetEntryAtIndex(unsigned long) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::GetEntryAtIndex(unsigned long) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::GetEntryAtIndex(unsigned long) const Line | Count | Source | 528 | 12 | const Entry *GetEntryAtIndex(size_t i) const { | 529 | 12 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 530 | 12 | } |
|
531 | | |
532 | 202M | Entry *GetMutableEntryAtIndex(size_t i) { |
533 | 202M | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); |
534 | 202M | } lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::GetMutableEntryAtIndex(unsigned long) Line | Count | Source | 532 | 202M | Entry *GetMutableEntryAtIndex(size_t i) { | 533 | 202M | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 534 | 202M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::GetMutableEntryAtIndex(unsigned long) Line | Count | Source | 532 | 530 | Entry *GetMutableEntryAtIndex(size_t i) { | 533 | 530 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 534 | 530 | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::GetMutableEntryAtIndex(unsigned long) lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::GetMutableEntryAtIndex(unsigned long) Line | Count | Source | 532 | 64 | Entry *GetMutableEntryAtIndex(size_t i) { | 533 | 64 | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); | 534 | 64 | } |
|
535 | | |
536 | | // Clients must ensure that "i" is a valid index prior to calling this |
537 | | // function |
538 | 1.00k | Entry &GetEntryRef(size_t i) { return m_entries[i]; } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::GetEntryRef(unsigned long) Line | Count | Source | 538 | 873 | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::GetEntryRef(unsigned long) Line | Count | Source | 538 | 14 | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::GetEntryRef(unsigned long) Line | Count | Source | 538 | 8 | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::GetEntryRef(unsigned long) Line | Count | Source | 538 | 105 | Entry &GetEntryRef(size_t i) { return m_entries[i]; } |
|
539 | 6.31k | const Entry &GetEntryRef(size_t i) const { return m_entries[i]; } |
540 | | |
541 | 41.5M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { |
542 | 41.5M | return lhs.GetRangeBase() < rhs.GetRangeBase(); |
543 | 41.5M | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&) Line | Count | Source | 541 | 2.35M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 2.35M | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 2.35M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&) Line | Count | Source | 541 | 165k | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 165k | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 165k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) Line | Count | Source | 541 | 37.4M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 37.4M | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 37.4M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&) Line | Count | Source | 541 | 504 | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 504 | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 504 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&) Line | Count | Source | 541 | 1 | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 1 | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 1 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&, lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&) Line | Count | Source | 541 | 426k | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 426k | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 426k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&, lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::BaseLessThan(lldb_private::RangeData<unsigned int, unsigned int, int> const&, lldb_private::RangeData<unsigned int, unsigned int, int> const&) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&, lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&) lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&) Line | Count | Source | 541 | 1.12M | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 1.12M | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 1.12M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&) Line | Count | Source | 541 | 47 | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 47 | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 47 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::BaseLessThan(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&, lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&) Line | Count | Source | 541 | 108 | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { | 542 | 108 | return lhs.GetRangeBase() < rhs.GetRangeBase(); | 543 | 108 | } |
|
544 | | |
545 | 20.6k | uint32_t FindEntryIndexThatContains(B addr) const { |
546 | 20.6k | const AugmentedEntry *entry = |
547 | 20.6k | static_cast<const AugmentedEntry *>(FindEntryThatContains(addr)); |
548 | 20.6k | if (entry) |
549 | 20.5k | return std::distance(m_entries.begin(), entry); |
550 | 78 | return UINT32_MAX; |
551 | 20.6k | } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::FindEntryIndexThatContains(unsigned long long) const Line | Count | Source | 545 | 341 | uint32_t FindEntryIndexThatContains(B addr) const { | 546 | 341 | const AugmentedEntry *entry = | 547 | 341 | static_cast<const AugmentedEntry *>(FindEntryThatContains(addr)); | 548 | 341 | if (entry) | 549 | 328 | return std::distance(m_entries.begin(), entry); | 550 | 13 | return UINT32_MAX; | 551 | 341 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::FindEntryIndexThatContains(unsigned long long) const Line | Count | Source | 545 | 20.2k | uint32_t FindEntryIndexThatContains(B addr) const { | 546 | 20.2k | const AugmentedEntry *entry = | 547 | 20.2k | static_cast<const AugmentedEntry *>(FindEntryThatContains(addr)); | 548 | 20.2k | if (entry) | 549 | 20.2k | return std::distance(m_entries.begin(), entry); | 550 | 0 | return UINT32_MAX; | 551 | 20.2k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::FindEntryIndexThatContains(unsigned long long) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::FindEntryIndexThatContains(unsigned long long) const Line | Count | Source | 545 | 86 | uint32_t FindEntryIndexThatContains(B addr) const { | 546 | 86 | const AugmentedEntry *entry = | 547 | 86 | static_cast<const AugmentedEntry *>(FindEntryThatContains(addr)); | 548 | 86 | if (entry) | 549 | 21 | return std::distance(m_entries.begin(), entry); | 550 | 65 | return UINT32_MAX; | 551 | 86 | } |
|
552 | | |
553 | 393k | uint32_t FindEntryIndexesThatContain(B addr, std::vector<uint32_t> &indexes) { |
554 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
555 | | assert(IsSorted()); |
556 | | #endif |
557 | 393k | if (!m_entries.empty()) |
558 | 392k | FindEntryIndexesThatContain(addr, 0, m_entries.size(), indexes); |
559 | | |
560 | 393k | return indexes.size(); |
561 | 393k | } |
562 | | |
563 | 2.95M | Entry *FindEntryThatContains(B addr) { |
564 | 2.95M | return const_cast<Entry *>( |
565 | 2.95M | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( |
566 | 2.95M | addr)); |
567 | 2.95M | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 275 | Entry *FindEntryThatContains(B addr) { | 564 | 275 | return const_cast<Entry *>( | 565 | 275 | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 275 | addr)); | 567 | 275 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 2.60M | Entry *FindEntryThatContains(B addr) { | 564 | 2.60M | return const_cast<Entry *>( | 565 | 2.60M | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 2.60M | addr)); | 567 | 2.60M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 3 | Entry *FindEntryThatContains(B addr) { | 564 | 3 | return const_cast<Entry *>( | 565 | 3 | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 3 | addr)); | 567 | 3 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 55.5k | Entry *FindEntryThatContains(B addr) { | 564 | 55.5k | return const_cast<Entry *>( | 565 | 55.5k | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 55.5k | addr)); | 567 | 55.5k | } |
Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::FindEntryThatContains(unsigned int) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::FindEntryThatContains(unsigned long long) lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 291k | Entry *FindEntryThatContains(B addr) { | 564 | 291k | return const_cast<Entry *>( | 565 | 291k | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 291k | addr)); | 567 | 291k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::FindEntryThatContains(unsigned long long) Line | Count | Source | 563 | 57 | Entry *FindEntryThatContains(B addr) { | 564 | 57 | return const_cast<Entry *>( | 565 | 57 | static_cast<const RangeDataVector *>(this)->FindEntryThatContains( | 566 | 57 | addr)); | 567 | 57 | } |
|
568 | | |
569 | 4.51M | const Entry *FindEntryThatContains(B addr) const { |
570 | 4.51M | return FindEntryThatContains(Entry(addr, 1)); |
571 | 4.51M | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 1.51M | const Entry *FindEntryThatContains(B addr) const { | 570 | 1.51M | return FindEntryThatContains(Entry(addr, 1)); | 571 | 1.51M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 27.5k | const Entry *FindEntryThatContains(B addr) const { | 570 | 27.5k | return FindEntryThatContains(Entry(addr, 1)); | 571 | 27.5k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 2.60M | const Entry *FindEntryThatContains(B addr) const { | 570 | 2.60M | return FindEntryThatContains(Entry(addr, 1)); | 571 | 2.60M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 341 | const Entry *FindEntryThatContains(B addr) const { | 570 | 341 | return FindEntryThatContains(Entry(addr, 1)); | 571 | 341 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 3 | const Entry *FindEntryThatContains(B addr) const { | 570 | 3 | return FindEntryThatContains(Entry(addr, 1)); | 571 | 3 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 75.7k | const Entry *FindEntryThatContains(B addr) const { | 570 | 75.7k | return FindEntryThatContains(Entry(addr, 1)); | 571 | 75.7k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::FindEntryThatContains(unsigned long long) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::FindEntryThatContains(unsigned int) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::FindEntryThatContains(unsigned long long) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 291k | const Entry *FindEntryThatContains(B addr) const { | 570 | 291k | return FindEntryThatContains(Entry(addr, 1)); | 571 | 291k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 86 | const Entry *FindEntryThatContains(B addr) const { | 570 | 86 | return FindEntryThatContains(Entry(addr, 1)); | 571 | 86 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::FindEntryThatContains(unsigned long long) const Line | Count | Source | 569 | 57 | const Entry *FindEntryThatContains(B addr) const { | 570 | 57 | return FindEntryThatContains(Entry(addr, 1)); | 571 | 57 | } |
|
572 | | |
573 | 4.51M | const Entry *FindEntryThatContains(const Entry &range) const { |
574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
575 | | assert(IsSorted()); |
576 | | #endif |
577 | 4.51M | if (!m_entries.empty()) { |
578 | 4.51M | typename Collection::const_iterator begin = m_entries.begin(); |
579 | 4.51M | typename Collection::const_iterator end = m_entries.end(); |
580 | 4.51M | typename Collection::const_iterator pos = |
581 | 4.51M | std::lower_bound(begin, end, range, BaseLessThan); |
582 | | |
583 | 8.58M | while (pos != begin && pos[-1].Contains(range)7.07M ) |
584 | 4.07M | --pos; |
585 | | |
586 | 4.51M | if (pos != end && pos->Contains(range)4.51M ) |
587 | 4.50M | return &(*pos); |
588 | 4.51M | } |
589 | 4.92k | return nullptr; |
590 | 4.51M | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&) const Line | Count | Source | 573 | 1.51M | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 1.51M | if (!m_entries.empty()) { | 578 | 1.51M | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 1.51M | typename Collection::const_iterator end = m_entries.end(); | 580 | 1.51M | typename Collection::const_iterator pos = | 581 | 1.51M | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 3.00M | while (pos != begin && pos[-1].Contains(range)1.52M ) | 584 | 1.49M | --pos; | 585 | | | 586 | 1.51M | if (pos != end && pos->Contains(range)1.51M ) | 587 | 1.50M | return &(*pos); | 588 | 1.51M | } | 589 | 2.23k | return nullptr; | 590 | 1.51M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned long long> const&) const Line | Count | Source | 573 | 27.5k | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 27.5k | if (!m_entries.empty()) { | 578 | 27.5k | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 27.5k | typename Collection::const_iterator end = m_entries.end(); | 580 | 27.5k | typename Collection::const_iterator pos = | 581 | 27.5k | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 34.4k | while (pos != begin && pos[-1].Contains(range)29.1k ) | 584 | 6.90k | --pos; | 585 | | | 586 | 27.5k | if (pos != end && pos->Contains(range)27.5k ) | 587 | 27.5k | return &(*pos); | 588 | 27.5k | } | 589 | 9 | return nullptr; | 590 | 27.5k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&) const Line | Count | Source | 573 | 2.60M | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 2.60M | if (!m_entries.empty()) { | 578 | 2.60M | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 2.60M | typename Collection::const_iterator end = m_entries.end(); | 580 | 2.60M | typename Collection::const_iterator pos = | 581 | 2.60M | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 4.86M | while (pos != begin && pos[-1].Contains(range)4.86M ) | 584 | 2.25M | --pos; | 585 | | | 586 | 2.60M | if (pos != end && pos->Contains(range)2.60M ) | 587 | 2.60M | return &(*pos); | 588 | 2.60M | } | 589 | 1.27k | return nullptr; | 590 | 2.60M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::DWARFExpression> const&) const Line | Count | Source | 573 | 341 | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 341 | if (!m_entries.empty()) { | 578 | 333 | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 333 | typename Collection::const_iterator end = m_entries.end(); | 580 | 333 | typename Collection::const_iterator pos = | 581 | 333 | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 628 | while (pos != begin && pos[-1].Contains(range)486 ) | 584 | 295 | --pos; | 585 | | | 586 | 333 | if (pos != end && pos->Contains(range)332 ) | 587 | 328 | return &(*pos); | 588 | 333 | } | 589 | 13 | return nullptr; | 590 | 341 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Variable*> const&) const Line | Count | Source | 573 | 3 | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 3 | if (!m_entries.empty()) { | 578 | 1 | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 1 | typename Collection::const_iterator end = m_entries.end(); | 580 | 1 | typename Collection::const_iterator pos = | 581 | 1 | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 1 | while (pos != begin && pos[-1].Contains(range)0 ) | 584 | 0 | --pos; | 585 | | | 586 | 1 | if (pos != end && pos->Contains(range)) | 587 | 0 | return &(*pos); | 588 | 1 | } | 589 | 3 | return nullptr; | 590 | 3 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry> const&) const Line | Count | Source | 573 | 75.7k | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 75.7k | if (!m_entries.empty()) { | 578 | 75.7k | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 75.7k | typename Collection::const_iterator end = m_entries.end(); | 580 | 75.7k | typename Collection::const_iterator pos = | 581 | 75.7k | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 95.8k | while (pos != begin && pos[-1].Contains(range)78.7k ) | 584 | 20.0k | --pos; | 585 | | | 586 | 75.7k | if (pos != end && pos->Contains(range)75.4k ) | 587 | 74.5k | return &(*pos); | 588 | 75.7k | } | 589 | 1.20k | return nullptr; | 590 | 75.7k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::FindEntryThatContains(lldb_private::RangeData<unsigned int, unsigned int, int> const&) const Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int> > const&) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long> > const&) const Line | Count | Source | 573 | 291k | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 291k | if (!m_entries.empty()) { | 578 | 291k | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 291k | typename Collection::const_iterator end = m_entries.end(); | 580 | 291k | typename Collection::const_iterator pos = | 581 | 291k | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 582k | while (pos != begin && pos[-1].Contains(range)582k ) | 584 | 291k | --pos; | 585 | | | 586 | 291k | if (pos != end && pos->Contains(range)291k ) | 587 | 291k | return &(*pos); | 588 | 291k | } | 589 | 104 | return nullptr; | 590 | 291k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> const&) const Line | Count | Source | 573 | 86 | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 86 | if (!m_entries.empty()) { | 578 | 23 | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 23 | typename Collection::const_iterator end = m_entries.end(); | 580 | 23 | typename Collection::const_iterator pos = | 581 | 23 | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 37 | while (pos != begin && pos[-1].Contains(range)26 ) | 584 | 14 | --pos; | 585 | | | 586 | 23 | if (pos != end && pos->Contains(range)21 ) | 587 | 21 | return &(*pos); | 588 | 23 | } | 589 | 65 | return nullptr; | 590 | 86 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::FindEntryThatContains(lldb_private::RangeData<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark> const&) const Line | Count | Source | 573 | 57 | const Entry *FindEntryThatContains(const Entry &range) const { | 574 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 575 | | assert(IsSorted()); | 576 | | #endif | 577 | 57 | if (!m_entries.empty()) { | 578 | 38 | typename Collection::const_iterator begin = m_entries.begin(); | 579 | 38 | typename Collection::const_iterator end = m_entries.end(); | 580 | 38 | typename Collection::const_iterator pos = | 581 | 38 | std::lower_bound(begin, end, range, BaseLessThan); | 582 | | | 583 | 38 | while (pos != begin && pos[-1].Contains(range)25 ) | 584 | 0 | --pos; | 585 | | | 586 | 38 | if (pos != end && pos->Contains(range)37 ) | 587 | 37 | return &(*pos); | 588 | 38 | } | 589 | 20 | return nullptr; | 590 | 57 | } |
|
591 | | |
592 | 2.18k | const Entry *FindEntryStartsAt(B addr) const { |
593 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
594 | | assert(IsSorted()); |
595 | | #endif |
596 | 2.18k | if (!m_entries.empty()) { |
597 | 1.14k | auto begin = m_entries.begin(), end = m_entries.end(); |
598 | 1.14k | auto pos = std::lower_bound(begin, end, Entry(addr, 1), BaseLessThan); |
599 | 1.14k | if (pos != end && pos->base == addr643 ) |
600 | 302 | return &(*pos); |
601 | 1.14k | } |
602 | 1.88k | return nullptr; |
603 | 2.18k | } lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::FindEntryStartsAt(unsigned long long) const Line | Count | Source | 592 | 873 | const Entry *FindEntryStartsAt(B addr) const { | 593 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 594 | | assert(IsSorted()); | 595 | | #endif | 596 | 873 | if (!m_entries.empty()) { | 597 | 871 | auto begin = m_entries.begin(), end = m_entries.end(); | 598 | 871 | auto pos = std::lower_bound(begin, end, Entry(addr, 1), BaseLessThan); | 599 | 871 | if (pos != end && pos->base == addr442 ) | 600 | 286 | return &(*pos); | 601 | 871 | } | 602 | 587 | return nullptr; | 603 | 873 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::FindEntryStartsAt(unsigned long long) const Line | Count | Source | 592 | 1.31k | const Entry *FindEntryStartsAt(B addr) const { | 593 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 594 | | assert(IsSorted()); | 595 | | #endif | 596 | 1.31k | if (!m_entries.empty()) { | 597 | 276 | auto begin = m_entries.begin(), end = m_entries.end(); | 598 | 276 | auto pos = std::lower_bound(begin, end, Entry(addr, 1), BaseLessThan); | 599 | 276 | if (pos != end && pos->base == addr201 ) | 600 | 16 | return &(*pos); | 601 | 276 | } | 602 | 1.29k | return nullptr; | 603 | 1.31k | } |
|
604 | | |
605 | | // This method will return the entry that contains the given address, or the |
606 | | // entry following that address. If you give it an address of 0 and the |
607 | | // first entry starts at address 0x100, you will get the entry at 0x100. |
608 | | // |
609 | | // For most uses, FindEntryThatContains is the correct one to use, this is a |
610 | | // less commonly needed behavior. It was added for core file memory regions, |
611 | | // where we want to present a gap in the memory regions as a distinct region, |
612 | | // so we need to know the start address of the next memory section that |
613 | | // exists. |
614 | 7.98k | const Entry *FindEntryThatContainsOrFollows(B addr) const { |
615 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
616 | | assert(IsSorted()); |
617 | | #endif |
618 | 7.98k | if (!m_entries.empty()) { |
619 | 7.97k | typename Collection::const_iterator begin = m_entries.begin(); |
620 | 7.97k | typename Collection::const_iterator end = m_entries.end(); |
621 | 7.97k | typename Collection::const_iterator pos = llvm::lower_bound( |
622 | 38.5k | m_entries, addr, [](const Entry &lhs, B rhs_base) -> bool { |
623 | 38.5k | return lhs.GetRangeEnd() <= rhs_base; |
624 | 38.5k | }); lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContainsOrFollows(unsigned long long) const::'lambda'(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&, unsigned long long)::operator()(lldb_private::RangeData<unsigned long long, unsigned int, unsigned long long> const&, unsigned long long) const Line | Count | Source | 622 | 31.1k | m_entries, addr, [](const Entry &lhs, B rhs_base) -> bool { | 623 | 31.1k | return lhs.GetRangeEnd() <= rhs_base; | 624 | 31.1k | }); |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::FindEntryThatContainsOrFollows(unsigned long long) const::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&, unsigned long long)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations> const&, unsigned long long) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::FindEntryThatContainsOrFollows(unsigned long long) const::'lambda'(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, unsigned long long)::operator()(lldb_private::RangeData<unsigned long long, unsigned long long, unsigned int> const&, unsigned long long) const Line | Count | Source | 622 | 7.34k | m_entries, addr, [](const Entry &lhs, B rhs_base) -> bool { | 623 | 7.34k | return lhs.GetRangeEnd() <= rhs_base; | 624 | 7.34k | }); |
|
625 | | |
626 | 7.97k | while (pos != begin && pos[-1].Contains(addr)3.65k ) |
627 | 0 | --pos; |
628 | | |
629 | 7.97k | if (pos != end) |
630 | 7.85k | return &(*pos); |
631 | 7.97k | } |
632 | 131 | return nullptr; |
633 | 7.98k | } lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::FindEntryThatContainsOrFollows(unsigned long long) const Line | Count | Source | 614 | 6.31k | const Entry *FindEntryThatContainsOrFollows(B addr) const { | 615 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 616 | | assert(IsSorted()); | 617 | | #endif | 618 | 6.31k | if (!m_entries.empty()) { | 619 | 6.31k | typename Collection::const_iterator begin = m_entries.begin(); | 620 | 6.31k | typename Collection::const_iterator end = m_entries.end(); | 621 | 6.31k | typename Collection::const_iterator pos = llvm::lower_bound( | 622 | 6.31k | m_entries, addr, [](const Entry &lhs, B rhs_base) -> bool { | 623 | 6.31k | return lhs.GetRangeEnd() <= rhs_base; | 624 | 6.31k | }); | 625 | | | 626 | 6.31k | while (pos != begin && pos[-1].Contains(addr)2.22k ) | 627 | 0 | --pos; | 628 | | | 629 | 6.31k | if (pos != end) | 630 | 6.25k | return &(*pos); | 631 | 6.31k | } | 632 | 64 | return nullptr; | 633 | 6.31k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::FindEntryThatContainsOrFollows(unsigned long long) const lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::FindEntryThatContainsOrFollows(unsigned long long) const Line | Count | Source | 614 | 1.66k | const Entry *FindEntryThatContainsOrFollows(B addr) const { | 615 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED | 616 | | assert(IsSorted()); | 617 | | #endif | 618 | 1.66k | if (!m_entries.empty()) { | 619 | 1.65k | typename Collection::const_iterator begin = m_entries.begin(); | 620 | 1.65k | typename Collection::const_iterator end = m_entries.end(); | 621 | 1.65k | typename Collection::const_iterator pos = llvm::lower_bound( | 622 | 1.65k | m_entries, addr, [](const Entry &lhs, B rhs_base) -> bool { | 623 | 1.65k | return lhs.GetRangeEnd() <= rhs_base; | 624 | 1.65k | }); | 625 | | | 626 | 1.65k | while (pos != begin && pos[-1].Contains(addr)1.43k ) | 627 | 0 | --pos; | 628 | | | 629 | 1.65k | if (pos != end) | 630 | 1.60k | return &(*pos); | 631 | 1.65k | } | 632 | 67 | return nullptr; | 633 | 1.66k | } |
|
634 | | |
635 | 0 | uint32_t FindEntryIndexThatContainsOrFollows(B addr) const { |
636 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
637 | | assert(IsSorted()); |
638 | | #endif |
639 | 0 | const AugmentedEntry *entry = static_cast<const AugmentedEntry *>( |
640 | 0 | FindEntryThatContainsOrFollows(addr)); |
641 | 0 | if (entry) |
642 | 0 | return std::distance(m_entries.begin(), entry); |
643 | 0 | return UINT32_MAX; |
644 | 0 | } |
645 | | |
646 | 933 | Entry *Back() { return (m_entries.empty() ? nullptr66 : &m_entries.back()867 ); } |
647 | | |
648 | 18.1k | const Entry *Back() const { |
649 | 18.1k | return (m_entries.empty() ? nullptr0 : &m_entries.back()); |
650 | 18.1k | } |
651 | | |
652 | | using const_iterator = typename Collection::const_iterator; |
653 | 33 | const_iterator begin() const { return m_entries.begin(); } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::begin() const Line | Count | Source | 653 | 33 | const_iterator begin() const { return m_entries.begin(); } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::begin() const |
654 | 33 | const_iterator end() const { return m_entries.end(); } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::end() const Line | Count | Source | 654 | 33 | const_iterator end() const { return m_entries.end(); } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::end() const |
655 | | |
656 | | protected: |
657 | | Collection m_entries; |
658 | | Compare m_compare; |
659 | | |
660 | | private: |
661 | | // Compute extra information needed for search |
662 | 261M | B ComputeUpperBounds(size_t lo, size_t hi) { |
663 | 261M | size_t mid = (lo + hi) / 2; |
664 | 261M | AugmentedEntry &entry = m_entries[mid]; |
665 | | |
666 | 261M | entry.upper_bound = entry.base + entry.size; |
667 | | |
668 | 261M | if (lo < mid) |
669 | 153M | entry.upper_bound = |
670 | 153M | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); |
671 | | |
672 | 261M | if (mid + 1 < hi) |
673 | 107M | entry.upper_bound = |
674 | 107M | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); |
675 | | |
676 | 261M | return entry.upper_bound; |
677 | 261M | } lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::DWARFExpression, 0u, lldb_private::DWARFExpressionList::DWARFExpressionCompare>::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 280 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 280 | size_t mid = (lo + hi) / 2; | 664 | 280 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 280 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 280 | if (lo < mid) | 669 | 118 | entry.upper_bound = | 670 | 118 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 280 | if (mid + 1 < hi) | 673 | 19 | entry.upper_bound = | 674 | 19 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 280 | return entry.upper_bound; | 677 | 280 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned int, unsigned long long, 0u, std::__1::less<unsigned long long> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 253k | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 253k | size_t mid = (lo + hi) / 2; | 664 | 253k | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 253k | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 253k | if (lo < mid) | 669 | 144k | entry.upper_bound = | 670 | 144k | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 253k | if (mid + 1 < hi) | 673 | 100k | entry.upper_bound = | 674 | 100k | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 253k | return entry.upper_bound; | 677 | 253k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, lldb_private::Symtab::FileRangeToIndexMapCompare>::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 261M | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 261M | size_t mid = (lo + hi) / 2; | 664 | 261M | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 261M | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 261M | if (lo < mid) | 669 | 153M | entry.upper_bound = | 670 | 153M | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 261M | if (mid + 1 < hi) | 673 | 107M | entry.upper_bound = | 674 | 107M | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 261M | return entry.upper_bound; | 677 | 261M | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Variable*, 0u, std::__1::less<lldb_private::Variable*> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 1 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 1 | size_t mid = (lo + hi) / 2; | 664 | 1 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 1 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 1 | if (lo < mid) | 669 | 0 | entry.upper_bound = | 670 | 0 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 1 | if (mid + 1 < hi) | 673 | 0 | entry.upper_bound = | 674 | 0 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 1 | return entry.upper_bound; | 677 | 1 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, SymbolFileDWARFDebugMap::OSOEntry, 0u, std::__1::less<SymbolFileDWARFDebugMap::OSOEntry> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 38.8k | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 38.8k | size_t mid = (lo + hi) / 2; | 664 | 38.8k | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 38.8k | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 38.8k | if (lo < mid) | 669 | 20.7k | entry.upper_bound = | 670 | 20.7k | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 38.8k | if (mid + 1 < hi) | 673 | 17.1k | entry.upper_bound = | 674 | 17.1k | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 38.8k | return entry.upper_bound; | 677 | 38.8k | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned long long, 0u, std::__1::less<unsigned long long> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 20.2k | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 20.2k | size_t mid = (lo + hi) / 2; | 664 | 20.2k | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 20.2k | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 20.2k | if (lo < mid) | 669 | 11.1k | entry.upper_bound = | 670 | 11.1k | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 20.2k | if (mid + 1 < hi) | 673 | 8.18k | entry.upper_bound = | 674 | 8.18k | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 20.2k | return entry.upper_bound; | 677 | 20.2k | } |
Unexecuted instantiation: PdbUtil.cpp:lldb_private::RangeDataVector<unsigned long long, unsigned long long, (anonymous namespace)::MemberLocations, 0u, (anonymous namespace)::MemberLocations::Comparator>::ComputeUpperBounds(unsigned long, unsigned long) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned long long, unsigned int, std::__1::pair<unsigned int, unsigned int>, 0u, std::__1::less<std::__1::pair<unsigned int, unsigned int> > >::ComputeUpperBounds(unsigned long, unsigned long) Unexecuted instantiation: lldb_private::RangeDataVector<unsigned int, unsigned int, int, 0u, std::__1::less<int> >::ComputeUpperBounds(unsigned long, unsigned long) lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::Range<unsigned long long, unsigned long long>, 0u, std::__1::less<lldb_private::Range<unsigned long long, unsigned long long> > >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 6 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 6 | size_t mid = (lo + hi) / 2; | 664 | 6 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 6 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 6 | if (lo < mid) | 669 | 2 | entry.upper_bound = | 670 | 2 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 6 | if (mid + 1 < hi) | 673 | 2 | entry.upper_bound = | 674 | 2 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 6 | return entry.upper_bound; | 677 | 6 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, unsigned int, 0u, std::__1::less<unsigned int> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 6 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 6 | size_t mid = (lo + hi) / 2; | 664 | 6 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 6 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 6 | if (lo < mid) | 669 | 2 | entry.upper_bound = | 670 | 2 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 6 | if (mid + 1 < hi) | 673 | 2 | entry.upper_bound = | 674 | 2 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 6 | return entry.upper_bound; | 677 | 6 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::CompUnitData, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::CompUnitData> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 40 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 40 | size_t mid = (lo + hi) / 2; | 664 | 40 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 40 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 40 | if (lo < mid) | 669 | 17 | entry.upper_bound = | 670 | 17 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 40 | if (mid + 1 < hi) | 673 | 5 | entry.upper_bound = | 674 | 5 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 40 | return entry.upper_bound; | 677 | 40 | } |
lldb_private::RangeDataVector<unsigned long long, unsigned long long, lldb_private::breakpad::SymbolFileBreakpad::Bookmark, 0u, std::__1::less<lldb_private::breakpad::SymbolFileBreakpad::Bookmark> >::ComputeUpperBounds(unsigned long, unsigned long) Line | Count | Source | 662 | 29 | B ComputeUpperBounds(size_t lo, size_t hi) { | 663 | 29 | size_t mid = (lo + hi) / 2; | 664 | 29 | AugmentedEntry &entry = m_entries[mid]; | 665 | | | 666 | 29 | entry.upper_bound = entry.base + entry.size; | 667 | | | 668 | 29 | if (lo < mid) | 669 | 13 | entry.upper_bound = | 670 | 13 | std::max(entry.upper_bound, ComputeUpperBounds(lo, mid)); | 671 | | | 672 | 29 | if (mid + 1 < hi) | 673 | 10 | entry.upper_bound = | 674 | 10 | std::max(entry.upper_bound, ComputeUpperBounds(mid + 1, hi)); | 675 | | | 676 | 29 | return entry.upper_bound; | 677 | 29 | } |
|
678 | | |
679 | | // This is based on the augmented tree implementation found at |
680 | | // https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree |
681 | | void FindEntryIndexesThatContain(B addr, size_t lo, size_t hi, |
682 | 1.43M | std::vector<uint32_t> &indexes) { |
683 | 1.43M | size_t mid = (lo + hi) / 2; |
684 | 1.43M | const AugmentedEntry &entry = m_entries[mid]; |
685 | | |
686 | | // addr is greater than the rightmost point of any interval below mid |
687 | | // so there are cannot be any matches. |
688 | 1.43M | if (addr > entry.upper_bound) |
689 | 437k | return; |
690 | | |
691 | | // Recursively search left subtree |
692 | 995k | if (lo < mid) |
693 | 609k | FindEntryIndexesThatContain(addr, lo, mid, indexes); |
694 | | |
695 | | // If addr is smaller than the start of the current interval it |
696 | | // cannot contain it nor can any of its right subtree. |
697 | 995k | if (addr < entry.base) |
698 | 533k | return; |
699 | | |
700 | 461k | if (entry.Contains(addr)) |
701 | 391k | indexes.push_back(entry.data); |
702 | | |
703 | | // Recursively search right subtree |
704 | 461k | if (mid + 1 < hi) |
705 | 430k | FindEntryIndexesThatContain(addr, mid + 1, hi, indexes); |
706 | 461k | } |
707 | | }; |
708 | | |
709 | | // A simple range with data class where you get to define the type of |
710 | | // the range base "B", the type used for the range byte size "S", and the type |
711 | | // for the associated data "T". |
712 | | template <typename B, typename T> struct AddressData { |
713 | | typedef B BaseType; |
714 | | typedef T DataType; |
715 | | |
716 | | BaseType addr; |
717 | | DataType data; |
718 | | |
719 | 110M | AddressData() : addr(), data() {} |
720 | | |
721 | | AddressData(B a, DataType d) : addr(a), data(d) {} |
722 | | |
723 | | bool operator<(const AddressData &rhs) const { |
724 | | if (this->addr == rhs.addr) |
725 | | return this->data < rhs.data; |
726 | | return this->addr < rhs.addr; |
727 | | } |
728 | | |
729 | | bool operator==(const AddressData &rhs) const { |
730 | | return this->addr == rhs.addr && this->data == rhs.data; |
731 | | } |
732 | | |
733 | | bool operator!=(const AddressData &rhs) const { |
734 | | return this->addr != rhs.addr || this->data == rhs.data; |
735 | | } |
736 | | }; |
737 | | |
738 | | template <typename B, typename T, unsigned N> class AddressDataArray { |
739 | | public: |
740 | | typedef AddressData<B, T> Entry; |
741 | | typedef llvm::SmallVector<Entry, N> Collection; |
742 | | |
743 | 111k | AddressDataArray() = default; |
744 | | |
745 | 111k | ~AddressDataArray() = default; |
746 | | |
747 | 81.8M | void Append(const Entry &entry) { m_entries.push_back(entry); } |
748 | | |
749 | | void Sort() { |
750 | | if (m_entries.size() > 1) |
751 | | std::stable_sort(m_entries.begin(), m_entries.end()); |
752 | | } |
753 | | |
754 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
755 | | bool IsSorted() const { |
756 | | typename Collection::const_iterator pos, end, prev; |
757 | | // First we determine if we can combine any of the Entry objects so we |
758 | | // don't end up allocating and making a new collection for no reason |
759 | | for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; |
760 | | prev = pos++) { |
761 | | if (prev != end && *pos < *prev) |
762 | | return false; |
763 | | } |
764 | | return true; |
765 | | } |
766 | | #endif |
767 | | |
768 | | void Clear() { m_entries.clear(); } |
769 | | |
770 | | bool IsEmpty() const { return m_entries.empty(); } |
771 | | |
772 | 111k | size_t GetSize() const { return m_entries.size(); } |
773 | | |
774 | 14.3M | const Entry *GetEntryAtIndex(size_t i) const { |
775 | 14.3M | return ((i < m_entries.size()) ? &m_entries[i] : nullptr0 ); |
776 | 14.3M | } |
777 | | |
778 | | // Clients must ensure that "i" is a valid index prior to calling this |
779 | | // function |
780 | 81.8M | const Entry &GetEntryRef(size_t i) const { return m_entries[i]; } |
781 | | |
782 | 1.23G | static bool BaseLessThan(const Entry &lhs, const Entry &rhs) { |
783 | 1.23G | return lhs.addr < rhs.addr; |
784 | 1.23G | } |
785 | | |
786 | 110M | Entry *FindEntry(B addr, bool exact_match_only) { |
787 | | #ifdef ASSERT_RANGEMAP_ARE_SORTED |
788 | | assert(IsSorted()); |
789 | | #endif |
790 | 110M | if (!m_entries.empty()) { |
791 | 110M | Entry entry; |
792 | 110M | entry.addr = addr; |
793 | 110M | typename Collection::iterator begin = m_entries.begin(); |
794 | 110M | typename Collection::iterator end = m_entries.end(); |
795 | 110M | typename Collection::iterator pos = |
796 | 110M | llvm::lower_bound(m_entries, entry, BaseLessThan); |
797 | | |
798 | 110M | while (pos != begin && pos[-1].addr == addr110M ) |
799 | 0 | --pos; |
800 | | |
801 | 110M | if (pos != end) { |
802 | 74.7M | if (pos->addr == addr || !exact_match_only2.22k ) |
803 | 74.7M | return &(*pos); |
804 | 74.7M | } |
805 | 110M | } |
806 | 35.8M | return nullptr; |
807 | 110M | } |
808 | | |
809 | 84.3M | const Entry *FindNextEntry(const Entry *entry) { |
810 | 84.3M | if (entry >= &*m_entries.begin() && entry + 1 < &*m_entries.end()) |
811 | 84.1M | return entry + 1; |
812 | 111k | return nullptr; |
813 | 84.3M | } |
814 | | |
815 | | Entry *Back() { return (m_entries.empty() ? nullptr : &m_entries.back()); } |
816 | | |
817 | | const Entry *Back() const { |
818 | | return (m_entries.empty() ? nullptr : &m_entries.back()); |
819 | | } |
820 | | |
821 | | protected: |
822 | | Collection m_entries; |
823 | | }; |
824 | | |
825 | | } // namespace lldb_private |
826 | | |
827 | | #endif // LLDB_UTILITY_RANGEMAP_H |