We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dump_ct::cleanup_decl
1 parent 8a14e67 commit b5df13bCopy full SHA for b5df13b
src/goto-instrument/dump_c.cpp
@@ -650,19 +650,15 @@ void dump_ct::cleanup_decl(
650
std::list<irep_idt> &local_static,
651
std::list<irep_idt> &local_type_decls)
652
{
653
- const optionalt<exprt> value = decl.initial_value();
+ goto_programt tmp;
654
+ tmp.add(goto_programt::make_decl(decl.symbol()));
655
- if(value)
656
+ if(optionalt<exprt> value = decl.initial_value())
657
658
decl.set_initial_value({});
659
+ tmp.add(goto_programt::make_assignment(decl.symbol(), std::move(*value)));
660
}
661
- goto_programt tmp;
- tmp.add(goto_programt::make_decl(decl.symbol()));
662
-
663
664
- tmp.add(goto_programt::make_assignment(decl.symbol(), *value));
665
666
tmp.add(goto_programt::make_end_function());
667
668
// goto_program2codet requires valid location numbers:
0 commit comments