Skip to content

Commit aba7e75

Browse files
committed
cfgt accessors: use map type, not template instruction type
This is required because otherwise a cfgt<..., goto_programt::targett> wouldn't be able to accept const_targett as an argument to get_node_index(...) etc, which is undesirable. In particular its own entry_mapt::keys() would not be usable. In general this ought to be some constified version of 'I', but since base `cfgt` is currently restricted to either targett or const_targett then statically specifying const_targett suffices.
1 parent bb09891 commit aba7e75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/goto-programs/cfg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,19 @@ class cfg_baset:public grapht< cfg_base_nodet<T, I> >
187187
/// in that particular case you should just use `cfg.get_node(i)`). Storing
188188
/// node indices saves a map lookup, so it can be worthwhile when you expect
189189
/// to repeatedly look up the same program point.
190-
entryt get_node_index(const I &program_point) const
190+
entryt get_node_index(const goto_programt::const_targett &program_point) const
191191
{
192192
return entry_map.at(program_point);
193193
}
194194

195195
/// Get the CFG graph node relating to \p program_point.
196-
nodet &get_node(const I &program_point)
196+
nodet &get_node(const goto_programt::const_targett &program_point)
197197
{
198198
return (*this)[get_node_index(program_point)];
199199
}
200200

201201
/// Get the CFG graph node relating to \p program_point.
202-
const nodet &get_node(const I &program_point) const
202+
const nodet &get_node(const goto_programt::const_targett &program_point) const
203203
{
204204
return (*this)[get_node_index(program_point)];
205205
}

0 commit comments

Comments
 (0)