Skip to content

Commit ba576c4

Browse files
authored
Merge pull request #4462 from tautschnig/remove-value_set-idt
Remove value_sett::idt [blocks: #4463]
2 parents 9876561 + 6e5ec4d commit ba576c4

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ bool value_sett::field_sensitive(const irep_idt &id, const typet &type)
4848
return type.id() == ID_struct || type.id() == ID_struct_tag;
4949
}
5050

51-
value_sett::entryt *value_sett::find_entry(const value_sett::idt &id)
51+
value_sett::entryt *value_sett::find_entry(const irep_idt &id)
5252
{
5353
auto found = values.find(id);
5454
return found == values.end() ? nullptr : &found->second;
5555
}
5656

57-
const value_sett::entryt *
58-
value_sett::find_entry(const value_sett::idt &id) const
57+
const value_sett::entryt *value_sett::find_entry(const irep_idt &id) const
5958
{
6059
auto found = values.find(id);
6160
return found == values.end() ? nullptr : &found->second;
@@ -70,8 +69,8 @@ value_sett::entryt &value_sett::get_entry(const entryt &e, const typet &type)
7069
else
7170
index=e.identifier;
7271

73-
std::pair<valuest::iterator, bool> r=
74-
values.insert(std::pair<idt, entryt>(index, e));
72+
std::pair<valuest::iterator, bool> r =
73+
values.insert(std::pair<irep_idt, entryt>(index, e));
7574

7675
return r.first->second;
7776
}

src/pointer-analysis/value_set.h

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ class value_sett
7272
/// in value sets.
7373
static object_numberingt object_numbering;
7474

75-
typedef irep_idt idt;
76-
7775
/// Represents the offset into an object: either a unique integer offset,
7876
/// or an unknown value, represented by `!offset`.
7977
typedef optionalt<mp_integer> offsett;
@@ -249,16 +247,15 @@ class value_sett
249247
struct entryt
250248
{
251249
object_mapt object_map;
252-
idt identifier;
250+
irep_idt identifier;
253251
std::string suffix;
254252

255253
entryt()
256254
{
257255
}
258256

259-
entryt(const idt &_identifier, const std::string &_suffix):
260-
identifier(_identifier),
261-
suffix(_suffix)
257+
entryt(const irep_idt &_identifier, const std::string &_suffix)
258+
: identifier(_identifier), suffix(_suffix)
262259
{
263260
}
264261

@@ -297,11 +294,11 @@ class value_sett
297294
///
298295
/// The components of the ID are thus duplicated in the `valuest` key and in
299296
/// `entryt` fields.
300-
#ifdef USE_DSTRING
301-
typedef std::map<idt, entryt> valuest;
302-
#else
303-
typedef std::unordered_map<idt, entryt, string_hash> valuest;
304-
#endif
297+
#ifdef USE_DSTRING
298+
typedef std::map<irep_idt, entryt> valuest;
299+
#else
300+
typedef std::unordered_map<irep_idt, entryt, string_hash> valuest;
301+
#endif
305302

306303
/// Gets values pointed to by `expr`, including following dereference
307304
/// operators (i.e. this is not a simple lookup in `valuest`).
@@ -314,9 +311,7 @@ class value_sett
314311
const namespacet &ns) const;
315312

316313
/// Appears to be unimplemented.
317-
expr_sett &get(
318-
const idt &identifier,
319-
const std::string &suffix);
314+
expr_sett &get(const irep_idt &identifier, const std::string &suffix);
320315

321316
void clear()
322317
{
@@ -330,10 +325,10 @@ class value_sett
330325
/// \return a constant pointer to an entry if found, or null otherwise.
331326
/// Note the pointer may be invalidated by insert operations, including
332327
/// get_entry.
333-
entryt *find_entry(const idt &id);
328+
entryt *find_entry(const irep_idt &id);
334329

335330
/// Const version of \ref find_entry
336-
const entryt *find_entry(const idt &id) const;
331+
const entryt *find_entry(const irep_idt &id) const;
337332

338333
/// Gets or inserts an entry in this value-set.
339334
/// \param e: entry to find. Its `id` and `suffix` fields will be used

0 commit comments

Comments
 (0)