Coverage Report

Created: 2022-01-25 06:29

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Core/UniqueCStringMap.h
Line
Count
Source (jump to first uncovered line)
1
//===-- UniqueCStringMap.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_CORE_UNIQUECSTRINGMAP_H
10
#define LLDB_CORE_UNIQUECSTRINGMAP_H
11
12
#include <algorithm>
13
#include <vector>
14
15
#include "lldb/Utility/ConstString.h"
16
#include "lldb/Utility/RegularExpression.h"
17
18
namespace lldb_private {
19
20
// Templatized uniqued string map.
21
//
22
// This map is useful for mapping unique C string names to values of type T.
23
// Each "const char *" name added must be unique for a given
24
// C string value. ConstString::GetCString() can provide such strings.
25
// Any other string table that has guaranteed unique values can also be used.
26
template <typename T> class UniqueCStringMap {
27
public:
28
  struct Entry {
29
212M
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<unsigned int>::Entry::Entry(lldb_private::ConstString, unsigned int const&)
Line
Count
Source
29
211M
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Entry::Entry(lldb_private::ConstString, lldb_private::OptionValueEnumeration::EnumeratorInfo const&)
Line
Count
Source
29
174k
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<unsigned long>::Entry::Entry(lldb_private::ConstString, unsigned long const&)
Line
Count
Source
29
732k
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<lldb::BasicType>::Entry::Entry(lldb_private::ConstString, lldb::BasicType const&)
Line
Count
Source
29
96
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<DWARFDIE>::Entry::Entry(lldb_private::ConstString, DWARFDIE const&)
Line
Count
Source
29
8
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
lldb_private::UniqueCStringMap<DIERef>::Entry::Entry(lldb_private::ConstString, DIERef const&)
Line
Count
Source
29
100k
    Entry(ConstString cstr, const T &v) : cstring(cstr), value(v) {}
30
31
    ConstString cstring;
32
    T value;
33
  };
34
35
  typedef std::vector<Entry> collection;
36
  typedef typename collection::iterator iterator;
37
  typedef typename collection::const_iterator const_iterator;
38
39
  // Call this function multiple times to add a bunch of entries to this map,
40
  // then later call UniqueCStringMap<T>::Sort() before doing any searches by
41
  // name.
42
191M
  void Append(ConstString unique_cstr, const T &value) {
43
191M
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
191M
  }
lldb_private::UniqueCStringMap<unsigned int>::Append(lldb_private::ConstString, unsigned int const&)
Line
Count
Source
42
190M
  void Append(ConstString unique_cstr, const T &value) {
43
190M
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
190M
  }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Append(lldb_private::ConstString, lldb_private::OptionValueEnumeration::EnumeratorInfo const&)
Line
Count
Source
42
174k
  void Append(ConstString unique_cstr, const T &value) {
43
174k
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
174k
  }
lldb_private::UniqueCStringMap<unsigned long>::Append(lldb_private::ConstString, unsigned long const&)
Line
Count
Source
42
732k
  void Append(ConstString unique_cstr, const T &value) {
43
732k
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
732k
  }
lldb_private::UniqueCStringMap<lldb::BasicType>::Append(lldb_private::ConstString, lldb::BasicType const&)
Line
Count
Source
42
96
  void Append(ConstString unique_cstr, const T &value) {
43
96
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
96
  }
lldb_private::UniqueCStringMap<DWARFDIE>::Append(lldb_private::ConstString, DWARFDIE const&)
Line
Count
Source
42
8
  void Append(ConstString unique_cstr, const T &value) {
43
8
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
8
  }
lldb_private::UniqueCStringMap<DIERef>::Append(lldb_private::ConstString, DIERef const&)
Line
Count
Source
42
100k
  void Append(ConstString unique_cstr, const T &value) {
43
100k
    m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
44
100k
  }
45
46
28.0M
  void Append(const Entry &e) { m_map.push_back(e); }
47
48
57.5k
  void Clear() { m_map.clear(); }
lldb_private::UniqueCStringMap<unsigned int>::Clear()
Line
Count
Source
48
2.22k
  void Clear() { m_map.clear(); }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Clear()
Line
Count
Source
48
55.3k
  void Clear() { m_map.clear(); }
lldb_private::UniqueCStringMap<DIERef>::Clear()
Line
Count
Source
48
44
  void Clear() { m_map.clear(); }
49
50
  // Get an entries by index in a variety of forms.
51
  //
52
  // The caller is responsible for ensuring that the collection does not change
53
  // during while using the returned values.
54
  bool GetValueAtIndex(uint32_t idx, T &value) const {
55
    if (idx < m_map.size()) {
56
      value = m_map[idx].value;
57
      return true;
58
    }
59
    return false;
60
  }
61
62
50.4k
  ConstString GetCStringAtIndexUnchecked(uint32_t idx) const {
63
50.4k
    return m_map[idx].cstring;
64
50.4k
  }
65
66
  // Use this function if you have simple types in your map that you can easily
67
  // copy when accessing values by index.
68
50.6k
  T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::GetValueAtIndexUnchecked(unsigned int) const
Line
Count
Source
68
178
  T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
lldb_private::UniqueCStringMap<DWARFDIE>::GetValueAtIndexUnchecked(unsigned int) const
Line
Count
Source
68
14
  T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
lldb_private::UniqueCStringMap<DIERef>::GetValueAtIndexUnchecked(unsigned int) const
Line
Count
Source
68
50.4k
  T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
69
70
  // Use this function if you have complex types in your map that you don't
71
  // want to copy when accessing values by index.
72
72
  const T &GetValueRefAtIndexUnchecked(uint32_t idx) const {
73
72
    return m_map[idx].value;
74
72
  }
75
76
175
  ConstString GetCStringAtIndex(uint32_t idx) const {
77
175
    return ((idx < m_map.size()) ? m_map[idx].cstring : 
ConstString()0
);
78
175
  }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::GetCStringAtIndex(unsigned int) const
Line
Count
Source
76
101
  ConstString GetCStringAtIndex(uint32_t idx) const {
77
101
    return ((idx < m_map.size()) ? m_map[idx].cstring : 
ConstString()0
);
78
101
  }
lldb_private::UniqueCStringMap<DWARFDIE>::GetCStringAtIndex(unsigned int) const
Line
Count
Source
76
2
  ConstString GetCStringAtIndex(uint32_t idx) const {
77
2
    return ((idx < m_map.size()) ? m_map[idx].cstring : 
ConstString()0
);
78
2
  }
lldb_private::UniqueCStringMap<DIERef>::GetCStringAtIndex(unsigned int) const
Line
Count
Source
76
72
  ConstString GetCStringAtIndex(uint32_t idx) const {
77
72
    return ((idx < m_map.size()) ? m_map[idx].cstring : 
ConstString()0
);
78
72
  }
79
80
  // Find the value for the unique string in the map.
81
  //
82
  // Return the value for \a unique_cstr if one is found, return \a fail_value
83
  // otherwise. This method works well for simple type
84
  // T values and only if there is a sensible failure value that can
85
  // be returned and that won't match any existing values.
86
261k
  T Find(ConstString unique_cstr, T fail_value) const {
87
261k
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
88
261k
    if (pos != m_map.end() && 
pos->cstring == unique_cstr229k
)
89
179k
      return pos->value;
90
81.5k
    return fail_value;
91
261k
  }
lldb_private::UniqueCStringMap<unsigned long>::Find(lldb_private::ConstString, unsigned long) const
Line
Count
Source
86
261k
  T Find(ConstString unique_cstr, T fail_value) const {
87
261k
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
88
261k
    if (pos != m_map.end() && 
pos->cstring == unique_cstr229k
)
89
179k
      return pos->value;
90
81.5k
    return fail_value;
91
261k
  }
lldb_private::UniqueCStringMap<lldb::BasicType>::Find(lldb_private::ConstString, lldb::BasicType) const
Line
Count
Source
86
37
  T Find(ConstString unique_cstr, T fail_value) const {
87
37
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
88
37
    if (pos != m_map.end() && pos->cstring == unique_cstr)
89
34
      return pos->value;
90
3
    return fail_value;
91
37
  }
lldb_private::UniqueCStringMap<DWARFDIE>::Find(lldb_private::ConstString, DWARFDIE) const
Line
Count
Source
86
2
  T Find(ConstString unique_cstr, T fail_value) const {
87
2
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
88
2
    if (pos != m_map.end() && 
pos->cstring == unique_cstr0
)
89
0
      return pos->value;
90
2
    return fail_value;
91
2
  }
92
93
  // Get a pointer to the first entry that matches "name". nullptr will be
94
  // returned if there is no entry that matches "name".
95
  //
96
  // The caller is responsible for ensuring that the collection does not change
97
  // during while using the returned pointer.
98
1.09M
  const Entry *FindFirstValueForName(ConstString unique_cstr) const {
99
1.09M
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
100
1.09M
    if (pos != m_map.end() && 
pos->cstring == unique_cstr212k
)
101
5.16k
      return &(*pos);
102
1.09M
    return nullptr;
103
1.09M
  }
lldb_private::UniqueCStringMap<unsigned int>::FindFirstValueForName(lldb_private::ConstString) const
Line
Count
Source
98
1.09M
  const Entry *FindFirstValueForName(ConstString unique_cstr) const {
99
1.09M
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
100
1.09M
    if (pos != m_map.end() && 
pos->cstring == unique_cstr209k
)
101
1.30k
      return &(*pos);
102
1.09M
    return nullptr;
103
1.09M
  }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::FindFirstValueForName(lldb_private::ConstString) const
Line
Count
Source
98
3.86k
  const Entry *FindFirstValueForName(ConstString unique_cstr) const {
99
3.86k
    auto pos = llvm::lower_bound(m_map, unique_cstr, Compare());
100
3.86k
    if (pos != m_map.end() && pos->cstring == unique_cstr)
101
3.86k
      return &(*pos);
102
0
    return nullptr;
103
3.86k
  }
104
105
  // Get a pointer to the next entry that matches "name" from a previously
106
  // returned Entry pointer. nullptr will be returned if there is no subsequent
107
  // entry that matches "name".
108
  //
109
  // The caller is responsible for ensuring that the collection does not change
110
  // during while using the returned pointer.
111
4.29k
  const Entry *FindNextValueForName(const Entry *entry_ptr) const {
112
4.29k
    if (!m_map.empty()) {
113
4.29k
      const Entry *first_entry = &m_map[0];
114
4.29k
      const Entry *after_last_entry = first_entry + m_map.size();
115
4.29k
      const Entry *next_entry = entry_ptr + 1;
116
4.29k
      if (first_entry <= next_entry && next_entry < after_last_entry) {
117
4.07k
        if (next_entry->cstring == entry_ptr->cstring)
118
3.19k
          return next_entry;
119
4.07k
      }
120
4.29k
    }
121
1.10k
    return nullptr;
122
4.29k
  }
123
124
5.87M
  size_t GetValues(ConstString unique_cstr, std::vector<T> &values) const {
125
5.87M
    const size_t start_size = values.size();
126
127
5.87M
    for (const Entry &entry : llvm::make_range(std::equal_range(
128
5.87M
             m_map.begin(), m_map.end(), unique_cstr, Compare())))
129
281k
      values.push_back(entry.value);
130
131
5.87M
    return values.size() - start_size;
132
5.87M
  }
133
134
  size_t GetValues(const RegularExpression &regex,
135
0
                   std::vector<T> &values) const {
136
0
    const size_t start_size = values.size();
137
138
0
    const_iterator pos, end = m_map.end();
139
0
    for (pos = m_map.begin(); pos != end; ++pos) {
140
0
      if (regex.Execute(pos->cstring.GetCString()))
141
0
        values.push_back(pos->value);
142
0
    }
143
144
0
    return values.size() - start_size;
145
0
  }
146
147
  // Get the total number of entries in this map.
148
45.0k
  size_t GetSize() const { return m_map.size(); }
lldb_private::UniqueCStringMap<unsigned int>::GetSize() const
Line
Count
Source
148
10
  size_t GetSize() const { return m_map.size(); }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::GetSize() const
Line
Count
Source
148
101
  size_t GetSize() const { return m_map.size(); }
lldb_private::UniqueCStringMap<DWARFDIE>::GetSize() const
Line
Count
Source
148
16
  size_t GetSize() const { return m_map.size(); }
lldb_private::UniqueCStringMap<DIERef>::GetSize() const
Line
Count
Source
148
44.9k
  size_t GetSize() const { return m_map.size(); }
149
150
  // Returns true if this map is empty.
151
224
  bool IsEmpty() const { return m_map.empty(); }
lldb_private::UniqueCStringMap<unsigned int>::IsEmpty() const
Line
Count
Source
151
52
  bool IsEmpty() const { return m_map.empty(); }
lldb_private::UniqueCStringMap<DWARFDIE>::IsEmpty() const
Line
Count
Source
151
4
  bool IsEmpty() const { return m_map.empty(); }
lldb_private::UniqueCStringMap<DIERef>::IsEmpty() const
Line
Count
Source
151
168
  bool IsEmpty() const { return m_map.empty(); }
152
153
  // Reserve memory for at least "n" entries in the map. This is useful to call
154
  // when you know you will be adding a lot of entries using
155
  // UniqueCStringMap::Append() (which should be followed by a call to
156
  // UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
157
139k
  void Reserve(size_t n) { m_map.reserve(n); }
158
159
  // Sort the unsorted contents in this map. A typical code flow would be:
160
  // size_t approximate_num_entries = ....
161
  // UniqueCStringMap<uint32_t> my_map;
162
  // my_map.Reserve (approximate_num_entries);
163
  // for (...)
164
  // {
165
  //      my_map.Append (UniqueCStringMap::Entry(GetName(...), GetValue(...)));
166
  // }
167
  // my_map.Sort();
168
878k
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<unsigned int>::Sort()
Line
Count
Source
168
573k
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Sort()
Line
Count
Source
168
55.3k
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<unsigned long>::Sort()
Line
Count
Source
168
206k
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<lldb::BasicType>::Sort()
Line
Count
Source
168
3
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<DWARFDIE>::Sort()
Line
Count
Source
168
2
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
lldb_private::UniqueCStringMap<DIERef>::Sort()
Line
Count
Source
168
43.2k
  void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); }
169
170
  // Since we are using a vector to contain our items it will always double its
171
  // memory consumption as things are added to the vector, so if you intend to
172
  // keep a UniqueCStringMap around and have a lot of entries in the map, you
173
  // will want to call this function to create a new vector and copy _only_ the
174
  // exact size needed as part of the finalization of the string map.
175
600k
  void SizeToFit() {
176
600k
    if (m_map.size() < m_map.capacity()) {
177
195k
      collection temp(m_map.begin(), m_map.end());
178
195k
      m_map.swap(temp);
179
195k
    }
180
600k
  }
lldb_private::UniqueCStringMap<unsigned int>::SizeToFit()
Line
Count
Source
175
557k
  void SizeToFit() {
176
557k
    if (m_map.size() < m_map.capacity()) {
177
193k
      collection temp(m_map.begin(), m_map.end());
178
193k
      m_map.swap(temp);
179
193k
    }
180
557k
  }
lldb_private::UniqueCStringMap<DIERef>::SizeToFit()
Line
Count
Source
175
43.2k
  void SizeToFit() {
176
43.2k
    if (m_map.size() < m_map.capacity()) {
177
2.02k
      collection temp(m_map.begin(), m_map.end());
178
2.02k
      m_map.swap(temp);
179
2.02k
    }
180
43.2k
  }
181
182
  iterator begin() { return m_map.begin(); }
183
  iterator end() { return m_map.end(); }
184
78
  const_iterator begin() const { return m_map.begin(); }
lldb_private::UniqueCStringMap<unsigned int>::begin() const
Line
Count
Source
184
10
  const_iterator begin() const { return m_map.begin(); }
lldb_private::UniqueCStringMap<DIERef>::begin() const
Line
Count
Source
184
68
  const_iterator begin() const { return m_map.begin(); }
185
78
  const_iterator end() const { return m_map.end(); }
lldb_private::UniqueCStringMap<unsigned int>::end() const
Line
Count
Source
185
10
  const_iterator end() const { return m_map.end(); }
lldb_private::UniqueCStringMap<DIERef>::end() const
Line
Count
Source
185
68
  const_iterator end() const { return m_map.end(); }
186
187
  // Range-based for loop for all entries of the specified ConstString name.
188
  llvm::iterator_range<const_iterator>
189
257k
  equal_range(ConstString unique_cstr) const {
190
257k
    return llvm::make_range(
191
257k
        std::equal_range(m_map.begin(), m_map.end(), unique_cstr, Compare()));
192
257k
  };
193
194
protected:
195
  struct Compare {
196
3.27G
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
3.27G
      return operator()(lhs.cstring, rhs.cstring);
198
3.27G
    }
lldb_private::UniqueCStringMap<unsigned int>::Compare::operator()(lldb_private::UniqueCStringMap<unsigned int>::Entry const&, lldb_private::UniqueCStringMap<unsigned int>::Entry const&)
Line
Count
Source
196
3.27G
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
3.27G
      return operator()(lhs.cstring, rhs.cstring);
198
3.27G
    }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Compare::operator()(lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Entry const&, lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Entry const&)
Line
Count
Source
196
159k
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
159k
      return operator()(lhs.cstring, rhs.cstring);
198
159k
    }
lldb_private::UniqueCStringMap<unsigned long>::Compare::operator()(lldb_private::UniqueCStringMap<unsigned long>::Entry const&, lldb_private::UniqueCStringMap<unsigned long>::Entry const&)
Line
Count
Source
196
7.81M
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
7.81M
      return operator()(lhs.cstring, rhs.cstring);
198
7.81M
    }
lldb_private::UniqueCStringMap<lldb::BasicType>::Compare::operator()(lldb_private::UniqueCStringMap<lldb::BasicType>::Entry const&, lldb_private::UniqueCStringMap<lldb::BasicType>::Entry const&)
Line
Count
Source
196
406
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
406
      return operator()(lhs.cstring, rhs.cstring);
198
406
    }
Unexecuted instantiation: lldb_private::UniqueCStringMap<DWARFDIE>::Compare::operator()(lldb_private::UniqueCStringMap<DWARFDIE>::Entry const&, lldb_private::UniqueCStringMap<DWARFDIE>::Entry const&)
lldb_private::UniqueCStringMap<DIERef>::Compare::operator()(lldb_private::UniqueCStringMap<DIERef>::Entry const&, lldb_private::UniqueCStringMap<DIERef>::Entry const&)
Line
Count
Source
196
134k
    bool operator()(const Entry &lhs, const Entry &rhs) {
197
134k
      return operator()(lhs.cstring, rhs.cstring);
198
134k
    }
199
200
52.8M
    bool operator()(const Entry &lhs, ConstString rhs) {
201
52.8M
      return operator()(lhs.cstring, rhs);
202
52.8M
    }
lldb_private::UniqueCStringMap<unsigned int>::Compare::operator()(lldb_private::UniqueCStringMap<unsigned int>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
51.6M
    bool operator()(const Entry &lhs, ConstString rhs) {
201
51.6M
      return operator()(lhs.cstring, rhs);
202
51.6M
    }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Compare::operator()(lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
7.73k
    bool operator()(const Entry &lhs, ConstString rhs) {
201
7.73k
      return operator()(lhs.cstring, rhs);
202
7.73k
    }
lldb_private::UniqueCStringMap<unsigned long>::Compare::operator()(lldb_private::UniqueCStringMap<unsigned long>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
962k
    bool operator()(const Entry &lhs, ConstString rhs) {
201
962k
      return operator()(lhs.cstring, rhs);
202
962k
    }
lldb_private::UniqueCStringMap<lldb::BasicType>::Compare::operator()(lldb_private::UniqueCStringMap<lldb::BasicType>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
187
    bool operator()(const Entry &lhs, ConstString rhs) {
201
187
      return operator()(lhs.cstring, rhs);
202
187
    }
lldb_private::UniqueCStringMap<DWARFDIE>::Compare::operator()(lldb_private::UniqueCStringMap<DWARFDIE>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
2
    bool operator()(const Entry &lhs, ConstString rhs) {
201
2
      return operator()(lhs.cstring, rhs);
202
2
    }
lldb_private::UniqueCStringMap<DIERef>::Compare::operator()(lldb_private::UniqueCStringMap<DIERef>::Entry const&, lldb_private::ConstString)
Line
Count
Source
200
183k
    bool operator()(const Entry &lhs, ConstString rhs) {
201
183k
      return operator()(lhs.cstring, rhs);
202
183k
    }
203
204
28.7M
    bool operator()(ConstString lhs, const Entry &rhs) {
205
28.7M
      return operator()(lhs, rhs.cstring);
206
28.7M
    }
lldb_private::UniqueCStringMap<unsigned int>::Compare::operator()(lldb_private::ConstString, lldb_private::UniqueCStringMap<unsigned int>::Entry const&)
Line
Count
Source
204
28.6M
    bool operator()(ConstString lhs, const Entry &rhs) {
205
28.6M
      return operator()(lhs, rhs.cstring);
206
28.6M
    }
lldb_private::UniqueCStringMap<DIERef>::Compare::operator()(lldb_private::ConstString, lldb_private::UniqueCStringMap<DIERef>::Entry const&)
Line
Count
Source
204
99.5k
    bool operator()(ConstString lhs, const Entry &rhs) {
205
99.5k
      return operator()(lhs, rhs.cstring);
206
99.5k
    }
207
208
    // This is only for uniqueness, not lexicographical ordering, so we can
209
    // just compare pointers. *However*, comparing pointers from different
210
    // allocations is UB, so we need compare their integral values instead.
211
3.35G
    bool operator()(ConstString lhs, ConstString rhs) {
212
3.35G
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
3.35G
    }
lldb_private::UniqueCStringMap<unsigned int>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
3.35G
    bool operator()(ConstString lhs, ConstString rhs) {
212
3.35G
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
3.35G
    }
lldb_private::UniqueCStringMap<lldb_private::OptionValueEnumeration::EnumeratorInfo>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
167k
    bool operator()(ConstString lhs, ConstString rhs) {
212
167k
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
167k
    }
lldb_private::UniqueCStringMap<unsigned long>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
8.78M
    bool operator()(ConstString lhs, ConstString rhs) {
212
8.78M
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
8.78M
    }
lldb_private::UniqueCStringMap<lldb::BasicType>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
593
    bool operator()(ConstString lhs, ConstString rhs) {
212
593
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
593
    }
lldb_private::UniqueCStringMap<DWARFDIE>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
2
    bool operator()(ConstString lhs, ConstString rhs) {
212
2
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
2
    }
lldb_private::UniqueCStringMap<DIERef>::Compare::operator()(lldb_private::ConstString, lldb_private::ConstString)
Line
Count
Source
211
417k
    bool operator()(ConstString lhs, ConstString rhs) {
212
417k
      return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString());
213
417k
    }
214
  };
215
  collection m_map;
216
};
217
218
} // namespace lldb_private
219
220
#endif // LLDB_CORE_UNIQUECSTRINGMAP_H