Skip to content

Commit a3d3c1d

Browse files
goto_analyzer_parse_optionst is not a messaget
This class already inherits a log field referencing the same thing.
1 parent 097a58d commit a3d3c1d

File tree

2 files changed

+34
-36
lines changed

2 files changed

+34
-36
lines changed

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ goto_analyzer_parse_optionst::goto_analyzer_parse_optionst(
7070
int argc,
7171
const char **argv)
7272
: parse_options_baset(GOTO_ANALYSER_OPTIONS, argc, argv, ui_message_handler),
73-
messaget(ui_message_handler),
7473
ui_message_handler(cmdline, std::string("GOTO-ANALYZER ") + CBMC_VERSION)
7574
{
7675
}
@@ -298,7 +297,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
298297
if(!options.get_bool_option("domain set"))
299298
{
300299
// Default to constants as it is light-weight but useful
301-
status() << "Domain not specified, defaulting to --constants" << eom;
300+
log.status() << "Domain not specified, defaulting to --constants"
301+
<< messaget::eom;
302302
options.set_option("constants", true);
303303
}
304304
}
@@ -386,20 +386,20 @@ int goto_analyzer_parse_optionst::doit()
386386

387387
optionst options;
388388
get_command_line_options(options);
389-
eval_verbosity(
389+
messaget::eval_verbosity(
390390
cmdline.get_value("verbosity"), messaget::M_STATISTICS, ui_message_handler);
391391

392392
//
393393
// Print a banner
394394
//
395-
status() << "GOTO-ANALYSER version " << CBMC_VERSION << " "
395+
log.status() << "GOTO-ANALYSER version " << CBMC_VERSION << " "
396396
<< sizeof(void *) * 8 << "-bit " << config.this_architecture() << " "
397-
<< config.this_operating_system() << eom;
397+
<< config.this_operating_system() << messaget::eom;
398398

399399
register_languages();
400400

401401
goto_model =
402-
initialize_goto_model(cmdline.args, get_message_handler(), options);
402+
initialize_goto_model(cmdline.args, log.get_message_handler(), options);
403403

404404
if(process_goto_program(options))
405405
return CPROVER_EXIT_INTERNAL_ERROR;
@@ -423,7 +423,7 @@ int goto_analyzer_parse_optionst::doit()
423423
{
424424
show_goto_functions(
425425
goto_model,
426-
get_message_handler(),
426+
log.get_message_handler(),
427427
get_ui(),
428428
cmdline.isset("list-goto-functions"));
429429
return CPROVER_EXIT_SUCCESS;
@@ -443,15 +443,15 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
443443

444444
if(cmdline.isset("show-taint"))
445445
{
446-
taint_analysis(goto_model, taint_file, get_message_handler(), true, "");
446+
taint_analysis(goto_model, taint_file, log.get_message_handler(), true, "");
447447
return CPROVER_EXIT_SUCCESS;
448448
}
449449
else
450450
{
451451
std::string json_file=cmdline.get_value("json");
452452
bool result=
453453
taint_analysis(
454-
goto_model, taint_file, get_message_handler(), false, json_file);
454+
goto_model, taint_file, log.get_message_handler(), false, json_file);
455455
return result ? CPROVER_EXIT_VERIFICATION_UNSAFE : CPROVER_EXIT_SUCCESS;
456456
}
457457
}
@@ -471,8 +471,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
471471
std::ofstream ofs(json_file);
472472
if(!ofs)
473473
{
474-
error() << "Failed to open json output `"
475-
<< json_file << "'" << eom;
474+
log.error() << "Failed to open json output `"
475+
<< json_file << "'" << messaget::eom;
476476
return CPROVER_EXIT_INTERNAL_ERROR;
477477
}
478478

@@ -496,8 +496,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
496496
std::ofstream ofs(json_file);
497497
if(!ofs)
498498
{
499-
error() << "Failed to open json output `"
500-
<< json_file << "'" << eom;
499+
log.error() << "Failed to open json output `"
500+
<< json_file << "'" << messaget::eom;
501501
return CPROVER_EXIT_INTERNAL_ERROR;
502502
}
503503

@@ -521,8 +521,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
521521
std::ofstream ofs(json_file);
522522
if(!ofs)
523523
{
524-
error() << "Failed to open json output `"
525-
<< json_file << "'" << eom;
524+
log.error() << "Failed to open json output `"
525+
<< json_file << "'" << messaget::eom;
526526
return CPROVER_EXIT_INTERNAL_ERROR;
527527
}
528528

@@ -553,7 +553,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
553553

554554
if(cmdline.isset("show-properties"))
555555
{
556-
show_properties(goto_model, get_message_handler(), get_ui());
556+
show_properties(goto_model, log.get_message_handler(), get_ui());
557557
return CPROVER_EXIT_SUCCESS;
558558
}
559559

@@ -574,29 +574,29 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
574574

575575
if(!out)
576576
{
577-
error() << "Failed to open output file `"
578-
<< outfile << "'" << eom;
577+
log.error() << "Failed to open output file `"
578+
<< outfile << "'" << messaget::eom;
579579
return CPROVER_EXIT_INTERNAL_ERROR;
580580
}
581581

582582
// Build analyzer
583-
status() << "Selecting abstract domain" << eom;
583+
log.status() << "Selecting abstract domain" << messaget::eom;
584584
namespacet ns(goto_model.symbol_table); // Must live as long as the domain.
585585
std::unique_ptr<ai_baset> analyzer(build_analyzer(options, ns));
586586

587587
if(analyzer == nullptr)
588588
{
589-
status() << "Task / Interpreter / Domain combination not supported"
589+
log.status() << "Task / Interpreter / Domain combination not supported"
590590
<< messaget::eom;
591591
return CPROVER_EXIT_INTERNAL_ERROR;
592592
}
593593

594594
// Run
595-
status() << "Computing abstract states" << eom;
595+
log.status() << "Computing abstract states" << messaget::eom;
596596
(*analyzer)(goto_model);
597597

598598
// Perform the task
599-
status() << "Performing task" << eom;
599+
log.status() << "Performing task" << messaget::eom;
600600

601601
bool result = true;
602602

@@ -607,15 +607,15 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
607607
}
608608
else if(options.get_bool_option("show-on-source"))
609609
{
610-
show_on_source(goto_model, *analyzer, get_message_handler());
610+
show_on_source(goto_model, *analyzer, log.get_message_handler());
611611
return CPROVER_EXIT_SUCCESS;
612612
}
613613
else if(options.get_bool_option("verify"))
614614
{
615615
result = static_verifier(goto_model,
616616
*analyzer,
617617
options,
618-
get_message_handler(),
618+
log.get_message_handler(),
619619
out);
620620
}
621621
else if(options.get_bool_option("simplify"))
@@ -626,7 +626,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
626626
result = static_simplifier(goto_model,
627627
*analyzer,
628628
options,
629-
get_message_handler(),
629+
log.get_message_handler(),
630630
out);
631631
}
632632
else if(options.get_bool_option("unreachable-instructions"))
@@ -652,7 +652,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
652652
}
653653
else
654654
{
655-
error() << "Unhandled task" << eom;
655+
log.error() << "Unhandled task" << messaget::eom;
656656
return CPROVER_EXIT_INTERNAL_ERROR;
657657
}
658658

@@ -662,8 +662,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
662662

663663

664664
// Final defensive error case
665-
error() << "no analysis option given -- consider reading --help"
666-
<< eom;
665+
log.error() << "no analysis option given -- consider reading --help"
666+
<< messaget::eom;
667667
return CPROVER_EXIT_USAGE_ERROR;
668668
}
669669

@@ -677,19 +677,19 @@ bool goto_analyzer_parse_optionst::process_goto_program(
677677
remove_asm(goto_model);
678678

679679
// add the library
680-
status() << "Adding CPROVER library (" << config.ansi_c.arch << ")" << eom;
680+
log.status() << "Adding CPROVER library (" << config.ansi_c.arch << ")" << messaget::eom;
681681
link_to_library(
682682
goto_model, ui_message_handler, cprover_cpp_library_factory);
683683
link_to_library(goto_model, ui_message_handler, cprover_c_library_factory);
684684
#endif
685685

686686
// remove function pointers
687-
status() << "Removing function pointers and virtual functions" << eom;
687+
log.status() << "Removing function pointers and virtual functions" << messaget::eom;
688688
remove_function_pointers(
689-
get_message_handler(), goto_model, cmdline.isset("pointer-check"));
689+
log.get_message_handler(), goto_model, cmdline.isset("pointer-check"));
690690

691691
// do partial inlining
692-
status() << "Partial Inlining" << eom;
692+
log.status() << "Partial Inlining" << messaget::eom;
693693
goto_partial_inline(goto_model, ui_message_handler);
694694

695695
// remove returns, gcc vectors, complex
@@ -699,7 +699,7 @@ bool goto_analyzer_parse_optionst::process_goto_program(
699699

700700
#if 0
701701
// add generic checks
702-
status() << "Generic Property Instrumentation" << eom;
702+
log.status() << "Generic Property Instrumentation" << messaget::eom;
703703
goto_check(options, goto_model);
704704
#else
705705
(void)options; // unused parameter

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ class optionst;
153153
OPT_VALIDATE \
154154
// clang-format on
155155

156-
class goto_analyzer_parse_optionst:
157-
public parse_options_baset,
158-
public messaget
156+
class goto_analyzer_parse_optionst: public parse_options_baset
159157
{
160158
public:
161159
virtual int doit() override;

0 commit comments

Comments
 (0)