Skip to content

Commit 46ec583

Browse files
show_goto_functions takes a ui_message_handler
This removes the need for passing a seperate ui argument.
1 parent a942d79 commit 46ec583

9 files changed

+17
-46
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,7 @@ int janalyzer_parse_optionst::doit()
389389
cmdline.isset("list-goto-functions"))
390390
{
391391
show_goto_functions(
392-
goto_model,
393-
ui_message_handler,
394-
ui_message_handler.get_ui(),
395-
cmdline.isset("list-goto-functions"));
392+
goto_model, ui_message_handler, cmdline.isset("list-goto-functions"));
396393
return CPROVER_EXIT_SUCCESS;
397394
}
398395

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,7 @@ int jbmc_parse_optionst::get_goto_program(
797797
cmdline.isset("list-goto-functions"))
798798
{
799799
show_goto_functions(
800-
*goto_model,
801-
ui_message_handler,
802-
ui_message_handler.get_ui(),
803-
cmdline.isset("list-goto-functions"));
800+
*goto_model, ui_message_handler, cmdline.isset("list-goto-functions"));
804801
return 0;
805802
}
806803

@@ -930,7 +927,6 @@ bool jbmc_parse_optionst::show_loaded_functions(
930927
show_goto_functions(
931928
ns,
932929
ui_message_handler,
933-
ui_message_handler.get_ui(),
934930
goto_model.get_goto_functions(),
935931
cmdline.isset("list-goto-functions"));
936932
return true;

jbmc/src/jdiff/jdiff_parse_options.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,9 @@ int jdiff_parse_optionst::doit()
227227
cmdline.isset("list-goto-functions"))
228228
{
229229
show_goto_functions(
230-
goto_model1,
231-
ui_message_handler,
232-
ui_message_handler.get_ui(),
233-
cmdline.isset("list-goto-functions"));
230+
goto_model1, ui_message_handler, cmdline.isset("list-goto-functions"));
234231
show_goto_functions(
235-
goto_model2,
236-
ui_message_handler,
237-
ui_message_handler.get_ui(),
238-
cmdline.isset("list-goto-functions"));
232+
goto_model2, ui_message_handler, cmdline.isset("list-goto-functions"));
239233
return CPROVER_EXIT_SUCCESS;
240234
}
241235

src/cbmc/cbmc_parse_options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ int cbmc_parse_optionst::get_goto_program(
733733
show_goto_functions(
734734
goto_model,
735735
ui_message_handler,
736-
ui_message_handler.get_ui(),
737736
cmdline.isset("list-goto-functions"));
738737
return CPROVER_EXIT_SUCCESS;
739738
}

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,7 @@ int goto_analyzer_parse_optionst::doit()
424424
cmdline.isset("list-goto-functions"))
425425
{
426426
show_goto_functions(
427-
goto_model,
428-
ui_message_handler,
429-
ui_message_handler.get_ui(),
430-
cmdline.isset("list-goto-functions"));
427+
goto_model, ui_message_handler, cmdline.isset("list-goto-functions"));
431428
return CPROVER_EXIT_SUCCESS;
432429
}
433430

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,9 @@ int goto_diff_parse_optionst::doit()
265265
cmdline.isset("list-goto-functions"))
266266
{
267267
show_goto_functions(
268-
goto_model1,
269-
ui_message_handler,
270-
ui_message_handler.get_ui(),
271-
cmdline.isset("list-goto-functions"));
268+
goto_model1, ui_message_handler, cmdline.isset("list-goto-functions"));
272269
show_goto_functions(
273-
goto_model2,
274-
ui_message_handler,
275-
ui_message_handler.get_ui(),
276-
cmdline.isset("list-goto-functions"));
270+
goto_model2, ui_message_handler, cmdline.isset("list-goto-functions"));
277271
return CPROVER_EXIT_SUCCESS;
278272
}
279273

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,7 @@ int goto_instrument_parse_optionst::doit()
616616
cmdline.isset("list-goto-functions"))
617617
{
618618
show_goto_functions(
619-
goto_model,
620-
ui_message_handler,
621-
ui_message_handler.get_ui(),
622-
cmdline.isset("list-goto-functions"));
619+
goto_model, ui_message_handler, cmdline.isset("list-goto-functions"));
623620
return CPROVER_EXIT_SUCCESS;
624621
}
625622

src/goto-programs/show_goto_functions.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Author: Peter Schrammel
2525

2626
void show_goto_functions(
2727
const namespacet &ns,
28-
message_handlert &message_handler,
29-
ui_message_handlert::uit ui,
28+
ui_message_handlert &ui_message_handler,
3029
const goto_functionst &goto_functions,
3130
bool list_only)
3231
{
33-
messaget msg(message_handler);
32+
ui_message_handlert::uit ui = ui_message_handler.get_ui();
33+
messaget msg(ui_message_handler);
3434
switch(ui)
3535
{
3636
case ui_message_handlert::uit::XML_UI:
@@ -82,11 +82,10 @@ void show_goto_functions(
8282

8383
void show_goto_functions(
8484
const goto_modelt &goto_model,
85-
message_handlert &message_handler,
86-
ui_message_handlert::uit ui,
85+
ui_message_handlert &ui_message_handler,
8786
bool list_only)
8887
{
8988
const namespacet ns(goto_model.symbol_table);
9089
show_goto_functions(
91-
ns, message_handler, ui, goto_model.goto_functions, list_only);
90+
ns, ui_message_handler, goto_model.goto_functions, list_only);
9291
}

src/goto-programs/show_goto_functions.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ class goto_functionst;
3030

3131
void show_goto_functions(
3232
const namespacet &ns,
33-
message_handlert &message_handler,
34-
ui_message_handlert::uit ui,
33+
ui_message_handlert &ui_message_handler,
3534
const goto_functionst &goto_functions,
36-
bool list_only = false);
35+
bool list_only);
3736

3837
void show_goto_functions(
3938
const goto_modelt &,
40-
message_handlert &message_handler,
41-
ui_message_handlert::uit ui,
42-
bool list_only = false);
39+
ui_message_handlert &ui_message_handler,
40+
bool list_only);
4341

4442
#endif // CPROVER_GOTO_PROGRAMS_SHOW_GOTO_FUNCTIONS_H

0 commit comments

Comments
 (0)