Skip to content

Commit 03554d5

Browse files
author
Owen
committed
Make non-const version of find_entry
1 parent d4f0d94 commit 03554d5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/pointer-analysis/value_set.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ 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-
const value_sett::entryt *value_sett::find_entry(const value_sett::idt &id)
52-
const
51+
value_sett::entryt *value_sett::find_entry(const value_sett::idt &id)
5352
{
5453
auto found = values.find(id);
5554
return found == values.end() ? nullptr : &found->second;
5655
}
5756

57+
const value_sett::entryt *value_sett::find_entry(const value_sett::idt &id)
58+
const
59+
{
60+
return const_cast<value_sett *>(this)->find_entry(id);
61+
}
62+
5863
value_sett::entryt &value_sett::get_entry(const entryt &e, const typet &type)
5964
{
6065
irep_idt index;

src/pointer-analysis/value_set.h

+3
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ class value_sett
328328
/// \return a constant pointer to an entry if found, or null otherwise.
329329
/// Note the pointer may be invalidated by insert operations, including
330330
/// get_entry.
331+
entryt *find_entry(const idt &id);
332+
333+
/// Const version of \ref find_entry
331334
const entryt *find_entry(const idt &id) const;
332335

333336
/// Gets or inserts an entry in this value-set.

0 commit comments

Comments
 (0)