Skip to content

Commit 2415aef

Browse files
Add a has method to symex_level1t
This will be used when we make the map for old L1 name be a symex_level1t as well.
1 parent 7c7b143 commit 2415aef

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/goto-symex/renaming_level.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ optionalt<std::pair<ssa_exprt, unsigned>> symex_level1t::insert_or_replace(
7878
return {};
7979
}
8080

81+
bool symex_level1t::has(const renamedt<ssa_exprt, L0> &ssa) const
82+
{
83+
return current_names.has_key(ssa.get().get_identifier());
84+
}
85+
8186
renamedt<ssa_exprt, L1> symex_level1t::
8287
operator()(renamedt<ssa_exprt, L0> l0_expr) const
8388
{

src/goto-symex/renaming_level.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ struct symex_level1t
6565
optionalt<std::pair<ssa_exprt, unsigned>>
6666
insert_or_replace(const renamedt<ssa_exprt, L0> &ssa, unsigned index);
6767

68+
/// \return true if \p ssa has an associated index
69+
bool has(const renamedt<ssa_exprt, L0> &ssa) const;
70+
6871
/// \return an SSA expression similar to \p l0_expr where the L1 tag has been
6972
/// set to the value in \ref current_names of the l1 object identifier of
7073
/// \p l0_expr

0 commit comments

Comments
 (0)