diff --git a/src/pointer-analysis/value_set.cpp b/src/pointer-analysis/value_set.cpp index cb8934722f5..3d76e386609 100644 --- a/src/pointer-analysis/value_set.cpp +++ b/src/pointer-analysis/value_set.cpp @@ -48,14 +48,13 @@ bool value_sett::field_sensitive(const irep_idt &id, const typet &type) return type.id() == ID_struct || type.id() == ID_struct_tag; } -value_sett::entryt *value_sett::find_entry(const value_sett::idt &id) +value_sett::entryt *value_sett::find_entry(const irep_idt &id) { auto found = values.find(id); return found == values.end() ? nullptr : &found->second; } -const value_sett::entryt * -value_sett::find_entry(const value_sett::idt &id) const +const value_sett::entryt *value_sett::find_entry(const irep_idt &id) const { auto found = values.find(id); return found == values.end() ? nullptr : &found->second; @@ -70,8 +69,8 @@ value_sett::entryt &value_sett::get_entry(const entryt &e, const typet &type) else index=e.identifier; - std::pair r= - values.insert(std::pair(index, e)); + std::pair r = + values.insert(std::pair(index, e)); return r.first->second; } diff --git a/src/pointer-analysis/value_set.h b/src/pointer-analysis/value_set.h index 5138f0c0e79..74dc870a1c8 100644 --- a/src/pointer-analysis/value_set.h +++ b/src/pointer-analysis/value_set.h @@ -72,8 +72,6 @@ class value_sett /// in value sets. static object_numberingt object_numbering; - typedef irep_idt idt; - /// Represents the offset into an object: either a unique integer offset, /// or an unknown value, represented by `!offset`. typedef optionalt offsett; @@ -249,16 +247,15 @@ class value_sett struct entryt { object_mapt object_map; - idt identifier; + irep_idt identifier; std::string suffix; entryt() { } - entryt(const idt &_identifier, const std::string &_suffix): - identifier(_identifier), - suffix(_suffix) + entryt(const irep_idt &_identifier, const std::string &_suffix) + : identifier(_identifier), suffix(_suffix) { } @@ -297,11 +294,11 @@ class value_sett /// /// The components of the ID are thus duplicated in the `valuest` key and in /// `entryt` fields. - #ifdef USE_DSTRING - typedef std::map valuest; - #else - typedef std::unordered_map valuest; - #endif +#ifdef USE_DSTRING + typedef std::map valuest; +#else + typedef std::unordered_map valuest; +#endif /// Gets values pointed to by `expr`, including following dereference /// operators (i.e. this is not a simple lookup in `valuest`). @@ -314,9 +311,7 @@ class value_sett const namespacet &ns) const; /// Appears to be unimplemented. - expr_sett &get( - const idt &identifier, - const std::string &suffix); + expr_sett &get(const irep_idt &identifier, const std::string &suffix); void clear() { @@ -330,10 +325,10 @@ class value_sett /// \return a constant pointer to an entry if found, or null otherwise. /// Note the pointer may be invalidated by insert operations, including /// get_entry. - entryt *find_entry(const idt &id); + entryt *find_entry(const irep_idt &id); /// Const version of \ref find_entry - const entryt *find_entry(const idt &id) const; + const entryt *find_entry(const irep_idt &id) const; /// Gets or inserts an entry in this value-set. /// \param e: entry to find. Its `id` and `suffix` fields will be used