Skip to content

cfgt: index entry-map by instruction location number, not the instruction itself #5049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/goto-programs/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ class cfg_baset:public grapht< cfg_base_nodet<T, I> >
/// in that particular case you should just use `cfg.get_node(i)`). Storing
/// node indices saves a map lookup, so it can be worthwhile when you expect
/// to repeatedly look up the same program point.
entryt get_node_index(const I &program_point) const
entryt get_node_index(const goto_programt::const_targett &program_point) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use pass-by-value 🍐

{
return entry_map.at(program_point);
}

/// Get the CFG graph node relating to \p program_point.
nodet &get_node(const I &program_point)
nodet &get_node(const goto_programt::const_targett &program_point)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍐

{
return (*this)[get_node_index(program_point)];
}

/// Get the CFG graph node relating to \p program_point.
const nodet &get_node(const I &program_point) const
const nodet &get_node(const goto_programt::const_targett &program_point) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍐

{
return (*this)[get_node_index(program_point)];
}
Expand Down