Skip to content

Commit 180397c

Browse files
author
Daniel Kroening
committed
use make_assignment(lhs, rhs)
This is slightly shorter.
1 parent 7463df0 commit 180397c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/analyses/goto_check.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ void goto_checkt::goto_check(
18331833
lhs);
18341834
goto_programt::targett t =
18351835
new_code.add(goto_programt::make_assignment(
1836-
code_assignt(std::move(lhs), std::move(rhs)), i.source_location));
1836+
std::move(lhs), std::move(rhs), i.source_location));
18371837
t->code.add_source_location()=i.source_location;
18381838
}
18391839
}
@@ -1848,8 +1848,7 @@ void goto_checkt::goto_check(
18481848
const symbol_exprt leak_expr=leak.symbol_expr();
18491849

18501850
// add self-assignment to get helpful counterexample output
1851-
new_code.add(
1852-
goto_programt::make_assignment(code_assignt(leak_expr, leak_expr)));
1851+
new_code.add(goto_programt::make_assignment(leak_expr, leak_expr));
18531852

18541853
source_locationt source_location;
18551854
source_location.set_function(function_identifier);

src/goto-instrument/dump_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ void dump_ct::cleanup_decl(
593593
tmp.add(goto_programt::make_decl(decl.symbol()));
594594

595595
if(value.is_not_nil())
596-
tmp.add(goto_programt::make_assignment(code_assignt(decl.op0(), value)));
596+
tmp.add(goto_programt::make_assignment(decl.symbol(), value));
597597

598598
tmp.add(goto_programt::make_end_function());
599599

0 commit comments

Comments
 (0)