@@ -70,7 +70,6 @@ goto_analyzer_parse_optionst::goto_analyzer_parse_optionst(
70
70
int argc,
71
71
const char **argv)
72
72
: parse_options_baset(GOTO_ANALYSER_OPTIONS, argc, argv, ui_message_handler),
73
- messaget(ui_message_handler),
74
73
ui_message_handler(cmdline, std::string(" GOTO-ANALYZER " ) + CBMC_VERSION)
75
74
{
76
75
}
@@ -298,7 +297,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
298
297
if (!options.get_bool_option (" domain set" ))
299
298
{
300
299
// 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;
302
302
options.set_option (" constants" , true );
303
303
}
304
304
}
@@ -386,20 +386,20 @@ int goto_analyzer_parse_optionst::doit()
386
386
387
387
optionst options;
388
388
get_command_line_options (options);
389
- eval_verbosity (
389
+ messaget:: eval_verbosity (
390
390
cmdline.get_value (" verbosity" ), messaget::M_STATISTICS, ui_message_handler);
391
391
392
392
//
393
393
// Print a banner
394
394
//
395
- status () << " GOTO-ANALYSER version " << CBMC_VERSION << " "
396
- << sizeof (void *) * 8 << " -bit " << config.this_architecture () << " "
397
- << config.this_operating_system () << eom;
395
+ log . status () << " GOTO-ANALYSER version " << CBMC_VERSION << " "
396
+ << sizeof (void *) * 8 << " -bit " << config.this_architecture ()
397
+ << " " << config.this_operating_system () << messaget:: eom;
398
398
399
399
register_languages ();
400
400
401
401
goto_model =
402
- initialize_goto_model (cmdline.args , get_message_handler (), options);
402
+ initialize_goto_model (cmdline.args , log . get_message_handler (), options);
403
403
404
404
if (process_goto_program (options))
405
405
return CPROVER_EXIT_INTERNAL_ERROR;
@@ -423,7 +423,7 @@ int goto_analyzer_parse_optionst::doit()
423
423
{
424
424
show_goto_functions (
425
425
goto_model,
426
- get_message_handler (),
426
+ log . get_message_handler (),
427
427
get_ui (),
428
428
cmdline.isset (" list-goto-functions" ));
429
429
return CPROVER_EXIT_SUCCESS;
@@ -443,15 +443,15 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
443
443
444
444
if (cmdline.isset (" show-taint" ))
445
445
{
446
- taint_analysis (goto_model, taint_file, get_message_handler (), true , " " );
446
+ taint_analysis (
447
+ goto_model, taint_file, log .get_message_handler (), true , " " );
447
448
return CPROVER_EXIT_SUCCESS;
448
449
}
449
450
else
450
451
{
451
452
std::string json_file=cmdline.get_value (" json" );
452
- bool result=
453
- taint_analysis (
454
- goto_model, taint_file, get_message_handler (), false , json_file);
453
+ bool result = taint_analysis (
454
+ goto_model, taint_file, log .get_message_handler (), false , json_file);
455
455
return result ? CPROVER_EXIT_VERIFICATION_UNSAFE : CPROVER_EXIT_SUCCESS;
456
456
}
457
457
}
@@ -471,8 +471,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
471
471
std::ofstream ofs (json_file);
472
472
if (!ofs)
473
473
{
474
- error () << " Failed to open json output `"
475
- << json_file << " ' " << eom;
474
+ log . error () << " Failed to open json output `" << json_file << " ' "
475
+ << messaget:: eom;
476
476
return CPROVER_EXIT_INTERNAL_ERROR;
477
477
}
478
478
@@ -496,8 +496,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
496
496
std::ofstream ofs (json_file);
497
497
if (!ofs)
498
498
{
499
- error () << " Failed to open json output `"
500
- << json_file << " ' " << eom;
499
+ log . error () << " Failed to open json output `" << json_file << " ' "
500
+ << messaget:: eom;
501
501
return CPROVER_EXIT_INTERNAL_ERROR;
502
502
}
503
503
@@ -521,8 +521,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
521
521
std::ofstream ofs (json_file);
522
522
if (!ofs)
523
523
{
524
- error () << " Failed to open json output `"
525
- << json_file << " ' " << eom;
524
+ log . error () << " Failed to open json output `" << json_file << " ' "
525
+ << messaget:: eom;
526
526
return CPROVER_EXIT_INTERNAL_ERROR;
527
527
}
528
528
@@ -553,7 +553,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
553
553
554
554
if (cmdline.isset (" show-properties" ))
555
555
{
556
- show_properties (goto_model, get_message_handler (), get_ui ());
556
+ show_properties (goto_model, log . get_message_handler (), get_ui ());
557
557
return CPROVER_EXIT_SUCCESS;
558
558
}
559
559
@@ -574,29 +574,29 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
574
574
575
575
if (!out)
576
576
{
577
- error () << " Failed to open output file `"
578
- << outfile << " ' " << eom;
577
+ log . error () << " Failed to open output file `" << outfile << " ' "
578
+ << messaget:: eom;
579
579
return CPROVER_EXIT_INTERNAL_ERROR;
580
580
}
581
581
582
582
// Build analyzer
583
- status () << " Selecting abstract domain" << eom;
583
+ log . status () << " Selecting abstract domain" << messaget:: eom;
584
584
namespacet ns (goto_model.symbol_table ); // Must live as long as the domain.
585
585
std::unique_ptr<ai_baset> analyzer (build_analyzer (options, ns));
586
586
587
587
if (analyzer == nullptr )
588
588
{
589
- status () << " Task / Interpreter / Domain combination not supported"
590
- << messaget::eom;
589
+ log . status () << " Task / Interpreter / Domain combination not supported"
590
+ << messaget::eom;
591
591
return CPROVER_EXIT_INTERNAL_ERROR;
592
592
}
593
593
594
594
// Run
595
- status () << " Computing abstract states" << eom;
595
+ log . status () << " Computing abstract states" << messaget:: eom;
596
596
(*analyzer)(goto_model);
597
597
598
598
// Perform the task
599
- status () << " Performing task" << eom;
599
+ log . status () << " Performing task" << messaget:: eom;
600
600
601
601
bool result = true ;
602
602
@@ -607,27 +607,21 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
607
607
}
608
608
else if (options.get_bool_option (" show-on-source" ))
609
609
{
610
- show_on_source (goto_model, *analyzer, get_message_handler ());
610
+ show_on_source (goto_model, *analyzer, log . get_message_handler ());
611
611
return CPROVER_EXIT_SUCCESS;
612
612
}
613
613
else if (options.get_bool_option (" verify" ))
614
614
{
615
- result = static_verifier (goto_model,
616
- *analyzer,
617
- options,
618
- get_message_handler (),
619
- out);
615
+ result = static_verifier (
616
+ goto_model, *analyzer, options, log .get_message_handler (), out);
620
617
}
621
618
else if (options.get_bool_option (" simplify" ))
622
619
{
623
620
PRECONDITION (!outfile.empty () && outfile != " -" );
624
621
output_stream.close ();
625
622
output_stream.open (outfile, std::ios::binary);
626
- result = static_simplifier (goto_model,
627
- *analyzer,
628
- options,
629
- get_message_handler (),
630
- out);
623
+ result = static_simplifier (
624
+ goto_model, *analyzer, options, log .get_message_handler (), out);
631
625
}
632
626
else if (options.get_bool_option (" unreachable-instructions" ))
633
627
{
@@ -652,7 +646,7 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
652
646
}
653
647
else
654
648
{
655
- error () << " Unhandled task" << eom;
649
+ log . error () << " Unhandled task" << messaget:: eom;
656
650
return CPROVER_EXIT_INTERNAL_ERROR;
657
651
}
658
652
@@ -662,8 +656,8 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
662
656
663
657
664
658
// Final defensive error case
665
- error () << " no analysis option given -- consider reading --help"
666
- << eom;
659
+ log . error () << " no analysis option given -- consider reading --help"
660
+ << messaget:: eom;
667
661
return CPROVER_EXIT_USAGE_ERROR;
668
662
}
669
663
@@ -677,19 +671,20 @@ bool goto_analyzer_parse_optionst::process_goto_program(
677
671
remove_asm(goto_model);
678
672
679
673
// add the library
680
- status() << "Adding CPROVER library (" << config.ansi_c.arch << ")" << eom;
674
+ log. status() << "Adding CPROVER library (" << config.ansi_c.arch << ")" << messaget:: eom;
681
675
link_to_library(
682
676
goto_model, ui_message_handler, cprover_cpp_library_factory);
683
677
link_to_library(goto_model, ui_message_handler, cprover_c_library_factory);
684
678
#endif
685
679
686
680
// remove function pointers
687
- status () << " Removing function pointers and virtual functions" << eom;
681
+ log .status () << " Removing function pointers and virtual functions"
682
+ << messaget::eom;
688
683
remove_function_pointers (
689
- get_message_handler (), goto_model, cmdline.isset (" pointer-check" ));
684
+ log . get_message_handler (), goto_model, cmdline.isset (" pointer-check" ));
690
685
691
686
// do partial inlining
692
- status () << " Partial Inlining" << eom;
687
+ log . status () << " Partial Inlining" << messaget:: eom;
693
688
goto_partial_inline (goto_model, ui_message_handler);
694
689
695
690
// remove returns, gcc vectors, complex
@@ -699,7 +694,7 @@ bool goto_analyzer_parse_optionst::process_goto_program(
699
694
700
695
#if 0
701
696
// add generic checks
702
- status() << "Generic Property Instrumentation" << eom;
697
+ log. status() << "Generic Property Instrumentation" << messaget:: eom;
703
698
goto_check(options, goto_model);
704
699
#else
705
700
(void )options; // unused parameter
0 commit comments