Skip to content

Commit 57c960f

Browse files
Make symex_output take renamedt args
This reflect the assumptions we should have on the arguments.
1 parent bd87e57 commit 57c960f

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/goto-symex/symex_builtin_functions.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,14 @@ void goto_symext::symex_output(
358358
PRECONDITION(code.operands().size() >= 2);
359359
exprt id_arg = state.rename(code.op0(), ns).get();
360360

361-
std::list<exprt> args;
361+
std::list<renamedt<exprt, L2>> args;
362362

363363
for(std::size_t i=1; i<code.operands().size(); i++)
364364
{
365-
exprt l2_arg = state.rename(code.operands()[i], ns).get();
366-
do_simplify(l2_arg);
367-
args.emplace_back(std::move(l2_arg));
365+
renamedt<exprt, L2> l2_arg = state.rename(code.operands()[i], ns);
366+
if(symex_config.simplify_opt)
367+
l2_arg.simplify(ns);
368+
args.emplace_back(l2_arg);
368369
}
369370

370371
const irep_idt output_id=get_string_argument(id_arg, ns);
@@ -470,12 +471,12 @@ void goto_symext::symex_trace(
470471

471472
if(symex_config.debug_level >= debug_lvl)
472473
{
473-
std::list<exprt> vars;
474+
std::list<renamedt<exprt, L2>> vars;
474475

475476
irep_idt event = to_string_constant(code.arguments()[1].op0()).get_value();
476477

477478
for(std::size_t j=2; j<code.arguments().size(); j++)
478-
vars.push_back(state.rename(code.arguments()[j], ns).get());
479+
vars.push_back(state.rename(code.arguments()[j], ns));
479480

480481
target.output(state.guard.as_expr(), state.source, event, vars);
481482
}

src/goto-symex/symex_target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class symex_targett
191191
const exprt &guard,
192192
const sourcet &source,
193193
const irep_idt &output_id,
194-
const std::list<exprt> &args)=0;
194+
const std::list<renamedt<exprt, L2>> &args) = 0;
195195

196196
/// Record formatted output.
197197
/// \param guard: Precondition for writing to the output

src/goto-symex/symex_target_equation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,14 @@ void symex_target_equationt::output(
224224
const exprt &guard,
225225
const sourcet &source,
226226
const irep_idt &output_id,
227-
const std::list<exprt> &args)
227+
const std::list<renamedt<exprt, L2>> &args)
228228
{
229229
SSA_steps.emplace_back(source, goto_trace_stept::typet::OUTPUT);
230230
SSA_stept &SSA_step=SSA_steps.back();
231231

232232
SSA_step.guard=guard;
233-
SSA_step.io_args=args;
233+
for(const auto &arg : args)
234+
SSA_step.io_args.emplace_back(arg.get());
234235
SSA_step.io_id=output_id;
235236

236237
merge_ireps(SSA_step);

src/goto-symex/symex_target_equation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class symex_target_equationt:public symex_targett
109109
const exprt &guard,
110110
const sourcet &source,
111111
const irep_idt &output_id,
112-
const std::list<exprt> &args);
112+
const std::list<renamedt<exprt, L2>> &args);
113113

114114
/// \copydoc symex_targett::output_fmt()
115115
virtual void output_fmt(

0 commit comments

Comments
 (0)