Skip to content

Commit 5845d01

Browse files
Show properties take a ui_message_handlert
This is more precise on the type of message handler we are expecting and makes the ui argument redundant.
1 parent c013400 commit 5845d01

File tree

7 files changed

+17
-29
lines changed

7 files changed

+17
-29
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ int janalyzer_parse_optionst::perform_analysis(const optionst &options)
520520

521521
if(cmdline.isset("show-properties"))
522522
{
523-
show_properties(
524-
goto_model, ui_message_handler, ui_message_handler.get_ui());
523+
show_properties(goto_model, ui_message_handler);
525524
return CPROVER_EXIT_SUCCESS;
526525
}
527526

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,7 @@ int jbmc_parse_optionst::doit()
563563

564564
if(cmdline.isset("show-properties"))
565565
{
566-
show_properties(
567-
goto_model, ui_message_handler, ui_message_handler.get_ui());
566+
show_properties(goto_model, ui_message_handler);
568567
return 0; // should contemplate EX_OK from sysexits.h
569568
}
570569

@@ -940,11 +939,7 @@ bool jbmc_parse_optionst::show_loaded_functions(
940939
if(cmdline.isset("show-properties"))
941940
{
942941
namespacet ns(goto_model.get_symbol_table());
943-
show_properties(
944-
ns,
945-
ui_message_handler,
946-
ui_message_handler.get_ui(),
947-
goto_model.get_goto_functions());
942+
show_properties(ns, ui_message_handler, goto_model.get_goto_functions());
948943
return true;
949944
}
950945

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ int cbmc_parse_optionst::doit()
555555
if(cmdline.isset("show-claims") || // will go away
556556
cmdline.isset("show-properties")) // use this one
557557
{
558-
show_properties(
559-
goto_model, ui_message_handler, ui_message_handler.get_ui());
558+
show_properties(goto_model, ui_message_handler);
560559
return CPROVER_EXIT_SUCCESS;
561560
}
562561

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
554554

555555
if(cmdline.isset("show-properties"))
556556
{
557-
show_properties(
558-
goto_model, ui_message_handler, ui_message_handler.get_ui());
557+
show_properties(goto_model, ui_message_handler);
559558
return CPROVER_EXIT_SUCCESS;
560559
}
561560

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,7 @@ int goto_instrument_parse_optionst::doit()
565565
cmdline.isset("show-properties"))
566566
{
567567
const namespacet ns(goto_model.symbol_table);
568-
show_properties(
569-
goto_model, ui_message_handler, ui_message_handler.get_ui());
568+
show_properties(goto_model, ui_message_handler);
570569
return CPROVER_EXIT_SUCCESS;
571570
}
572571

src/goto-programs/show_properties.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,25 +163,25 @@ void show_properties_json(
163163

164164
void show_properties(
165165
const namespacet &ns,
166-
message_handlert &message_handler,
167-
ui_message_handlert::uit ui,
166+
ui_message_handlert &ui_message_handler,
168167
const goto_functionst &goto_functions)
169168
{
169+
ui_message_handlert::uit ui = ui_message_handler.get_ui();
170170
if(ui == ui_message_handlert::uit::JSON_UI)
171-
show_properties_json(ns, message_handler, goto_functions);
171+
show_properties_json(ns, ui_message_handler, goto_functions);
172172
else
173173
for(const auto &fct : goto_functions.function_map)
174-
show_properties(ns, fct.first, message_handler, ui, fct.second.body);
174+
show_properties(ns, fct.first, ui_message_handler, ui, fct.second.body);
175175
}
176176

177177
void show_properties(
178178
const goto_modelt &goto_model,
179-
message_handlert &message_handler,
180-
ui_message_handlert::uit ui)
179+
ui_message_handlert &ui_message_handler)
181180
{
181+
ui_message_handlert::uit ui = ui_message_handler.get_ui();
182182
const namespacet ns(goto_model.symbol_table);
183183
if(ui == ui_message_handlert::uit::JSON_UI)
184-
show_properties_json(ns, message_handler, goto_model.goto_functions);
184+
show_properties_json(ns, ui_message_handler, goto_model.goto_functions);
185185
else
186-
show_properties(ns, message_handler, ui, goto_model.goto_functions);
186+
show_properties(ns, ui_message_handler, goto_model.goto_functions);
187187
}

src/goto-programs/show_properties.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ class message_handlert;
3030
" --show-properties show the properties, but don't run analysis\n" // NOLINT(*)
3131
// clang-format on
3232

33-
void show_properties(
34-
const goto_modelt &,
35-
message_handlert &message_handler,
36-
ui_message_handlert::uit ui);
33+
void
34+
show_properties(const goto_modelt &, ui_message_handlert &ui_message_handler);
3735

3836
void show_properties(
3937
const namespacet &ns,
40-
message_handlert &message_handler,
41-
ui_message_handlert::uit ui,
38+
ui_message_handlert &ui_message_handler,
4239
const goto_functionst &goto_functions);
4340

4441
/// \brief Returns a source_locationt that corresponds

0 commit comments

Comments
 (0)