Skip to content

Commit ad384f1

Browse files
kept consistency between parse options of cbmc and goto-instrument tools
Display the architecture information if the user intends to add the CPROVER library for code instrumentation. As a result, the status message is now part of the link_to_library implementation to avoid redundant code for the respective library call.
1 parent 29af567 commit ad384f1

8 files changed

+8
-10
lines changed

src/cbmc/cbmc_parse_options.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,6 @@ bool cbmc_parse_optionst::process_goto_program(
872872
remove_asm(symbol_table, goto_functions);
873873

874874
// add the library
875-
status() << "Adding CPROVER library ("
876-
<< config.ansi_c.arch << ")" << eom;
877875
link_to_library(symbol_table, goto_functions, ui_message_handler);
878876

879877
if(cmdline.isset("string-abstraction"))

src/clobber/clobber_parse_options.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ bool clobber_parse_optionst::get_goto_program(
368368

369369
// finally add the library
370370
#if 0
371-
status() << "Adding CPROVER library" << eom;
372371
link_to_library(symbol_table, goto_functions, ui_message_handler);
373372
#endif
374373

src/goto-analyzer/goto_analyzer_parse_options.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,6 @@ bool goto_analyzer_parse_optionst::process_goto_program(
378378
remove_asm(goto_model);
379379

380380
// add the library
381-
status() << "Adding CPROVER library ("
382-
<< config.ansi_c.arch << ")" << eom;
383381
link_to_library(goto_model, ui_message_handler);
384382
#endif
385383

src/goto-diff/goto_diff_parse_options.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,6 @@ bool goto_diff_parse_optionst::process_goto_program(
480480
remove_asm(symbol_table, goto_functions);
481481

482482
// add the library
483-
status() << "Adding CPROVER library ("
484-
<< config.ansi_c.arch << ")" << eom;
485483
link_to_library(symbol_table, goto_functions, ui_message_handler);
486484

487485
// remove function pointers

src/goto-instrument/goto_instrument_parse_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
983983
cmdline.isset("custom-bitvector-analysis"))
984984
config.ansi_c.defines.push_back("__CPROVER_CUSTOM_BITVECTOR_ANALYSIS");
985985

986-
status() << "Adding CPROVER library" << eom;
986+
// add the library
987987
link_to_library(symbol_table, goto_functions, ui_message_handler);
988988
}
989989

src/goto-programs/link_to_library.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Author: Daniel Kroening, [email protected]
66
77
\*******************************************************************/
88

9+
#include <util/config.h>
10+
911
#include <ansi-c/cprover_library.h>
1012

1113
#include "link_to_library.h"
@@ -54,6 +56,11 @@ void link_to_library(
5456
// this needs a fixedpoint, as library functions
5557
// may depend on other library functions
5658

59+
messaget message(message_handler);
60+
61+
message.status() << "Adding CPROVER library ("
62+
<< config.ansi_c.arch << ")" << messaget::eom;
63+
5764
std::set<irep_idt> added_functions;
5865

5966
while(true)

src/musketeer/musketeer_parse_options.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ void goto_fence_inserter_parse_optionst::instrument_goto_program(
200200

201201
// we add the library, as some analyses benefit
202202

203-
status() << "Adding CPROVER library" << eom;
204203
link_to_library(symbol_table, goto_functions, ui_message_handler);
205204

206205
namespacet ns(symbol_table);

src/symex/symex_parse_options.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ bool symex_parse_optionst::process_goto_program(const optionst &options)
355355
try
356356
{
357357
// we add the library
358-
status() << "Adding CPROVER library" << eom;
359358
link_to_library(goto_model, ui_message_handler);
360359

361360
// do partial inlining

0 commit comments

Comments
 (0)