Skip to content

Commit 9b79eb6

Browse files
committed
Removed legacy messaget interface, removed message_clientt
1 parent 61b350f commit 9b79eb6

File tree

14 files changed

+61
-156
lines changed

14 files changed

+61
-156
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ int cbmc_parse_optionst::get_goto_program(
661661

662662
language->set_message_handler(get_message_handler());
663663

664-
status("Parsing", filename);
664+
status() << "Parsing " << filename << eom;
665665

666666
if(language->parse(infile, filename))
667667
{

src/clobber/clobber_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ bool clobber_parse_optionst::get_goto_program(
326326

327327
language->set_message_handler(get_message_handler());
328328

329-
status("Parsing", filename);
329+
status() << "Parsing " << filename << eom;
330330

331331
if(language->parse(infile, filename))
332332
{

src/goto-cc/compile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Function: compilet::link
383383
bool compilet::link()
384384
{
385385
// "compile" hitherto uncompiled functions
386-
print(8, "Compiling functions");
386+
statistics() << "Compiling functions" << eom;
387387
convert_symbols(compiled_functions);
388388

389389
// parse object files
@@ -554,7 +554,7 @@ bool compilet::parse(const std::string &file_name)
554554

555555
if(mode==PREPROCESS_ONLY)
556556
{
557-
print(8, "Preprocessing: "+file_name);
557+
statistics() << "Preprocessing: " << file_name << eom;
558558

559559
std::ostream *os = &std::cout;
560560
std::ofstream ofs;
@@ -576,7 +576,7 @@ bool compilet::parse(const std::string &file_name)
576576
}
577577
else
578578
{
579-
print(8, "Parsing: "+file_name);
579+
statistics() << "Parsing: " << file_name << eom;
580580

581581
if(language.parse(infile, file_name))
582582
{
@@ -608,7 +608,7 @@ bool compilet::parse_stdin()
608608

609609
language.set_message_handler(get_message_handler());
610610

611-
print(8, "Parsing: (stdin)");
611+
statistics() << "Parsing: (stdin)" << eom;
612612

613613
if(mode==PREPROCESS_ONLY)
614614
{
@@ -872,7 +872,7 @@ void compilet::convert_symbols(goto_functionst &dest)
872872
s_it->second.value.id()!="compiled" &&
873873
s_it->second.value.is_not_nil())
874874
{
875-
print(9, "Compiling "+id2string(s_it->first));
875+
debug() << "Compiling " << s_it->first << eom;
876876
converter.convert_function(s_it->first);
877877
s_it->second.value=exprt("compiled");
878878
}

src/goto-programs/get_goto_model.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ bool get_goto_modelt::operator()(const cmdlinet &_cmdline)
8787

8888
if(lf.language==NULL)
8989
{
90-
error("failed to figure out type of file", filename);
90+
source_locationt location;
91+
location.set_file(filename);
92+
error().source_location=location;
93+
error() << "failed to figure out type of file" << eom;
9194
return true;
9295
}
9396

src/goto-symex/memory_model_pso.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Function: memory_model_psot::operator()
2222

2323
void memory_model_psot::operator()(symex_target_equationt &equation)
2424
{
25-
print(8, "Adding PSO constraints");
25+
statistics() << "Adding PSO constraints" << eom;
2626

2727
build_event_lists(equation);
2828
build_clock_type(equation);

src/goto-symex/memory_model_sc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Function: memory_model_sct::operator()
2424

2525
void memory_model_sct::operator()(symex_target_equationt &equation)
2626
{
27-
print(8, "Adding SC constraints");
27+
statistics() << "Adding SC constraints" << eom;
2828

2929
build_event_lists(equation);
3030
build_clock_type(equation);

src/goto-symex/memory_model_tso.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Function: memory_model_tsot::operator()
2525

2626
void memory_model_tsot::operator()(symex_target_equationt &equation)
2727
{
28-
print(8, "Adding TSO constraints");
28+
statistics() << "Adding TSO constraints" << eom;
2929

3030
build_event_lists(equation);
3131
build_clock_type(equation);

src/langapi/language_ui.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ bool language_uit::parse(const std::string &filename)
115115

116116
if(lf.language==NULL)
117117
{
118-
error("failed to figure out type of file", filename);
118+
source_locationt location;
119+
location.set_file(filename);
120+
error().source_location=location;
121+
error() << "failed to figure out type of file" << eom;
119122
return true;
120123
}
121124

src/solvers/prop/prop_conv.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,7 @@ void prop_conv_solvert::ignoring(const exprt &expr)
624624
{
625625
// fall through
626626

627-
std::string msg="warning: ignoring "+expr.pretty();
628-
629-
print(2, msg);
627+
warning() << "warning: ignoring " << expr.pretty() << eom;
630628
}
631629

632630
/*******************************************************************\
@@ -662,12 +660,12 @@ decision_proceduret::resultt prop_conv_solvert::dec_solve()
662660
// post-processing isn't incremental yet
663661
if(!post_processing_done)
664662
{
665-
print(8, "Post-processing");
663+
statistics() << "Post-processing" << eom;
666664
post_process();
667665
post_processing_done=true;
668666
}
669667

670-
print(7, "Solving with "+prop.solver_text());
668+
statistics() << "Solving with " << prop.solver_text() << eom;
671669

672670
propt::resultt result=prop.prop_solve();
673671

src/solvers/sat/pbs_dimacs_cnf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ bool pbs_dimacs_cnft::pbs_solve()
190190
// print(line);
191191
if(strstr(line.c_str(), "time out")!=NULL)
192192
{
193-
print(6, "WARNING: TIMED OUT. SOLUTION MAY BE INCORRECT.\n");
193+
status() << "WARNING: TIMED OUT. SOLUTION MAY BE INCORRECT."
194+
<< eom;
194195
return satisfied;
195196
}
196197
sscanf(line.c_str(), "%*s %*s %*s %d", &opt_sum);

src/util/cout_message.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ void gcc_message_handlert::print(
190190
else
191191
dest+=id2string(column)+": ";
192192

193-
if(level==message_clientt::M_ERROR)
193+
if(level==messaget::M_ERROR)
194194
dest+="error: ";
195-
else if(level==message_clientt::M_WARNING)
195+
else if(level==messaget::M_WARNING)
196196
dest+="warning: ";
197197
}
198198

src/util/message.cpp

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void message_handlert::print(
8888

8989
/*******************************************************************\
9090
91-
Function: messaget::print
91+
Function: messaget::~messaget
9292
9393
Inputs:
9494
@@ -98,65 +98,6 @@ Function: messaget::print
9898
9999
\*******************************************************************/
100100

101-
void messaget::print(unsigned level, const std::string &message)
101+
messaget::~messaget()
102102
{
103-
if(message_handler!=NULL)
104-
message_handler->print(level, message);
105-
}
106-
107-
/*******************************************************************\
108-
109-
Function: messaget::print
110-
111-
Inputs:
112-
113-
Outputs:
114-
115-
Purpose:
116-
117-
\*******************************************************************/
118-
119-
void messaget::print(
120-
unsigned level,
121-
const std::string &message,
122-
int sequence_number,
123-
const source_locationt &location)
124-
{
125-
if(message_handler!=NULL)
126-
message_handler->print(level, message, sequence_number,
127-
location);
128-
}
129-
130-
/*******************************************************************\
131-
132-
Function: message_clientt::~message_clientt
133-
134-
Inputs:
135-
136-
Outputs:
137-
138-
Purpose:
139-
140-
\*******************************************************************/
141-
142-
message_clientt::~message_clientt()
143-
{
144-
}
145-
146-
/*******************************************************************\
147-
148-
Function: message_clientt::set_message_handler
149-
150-
Inputs:
151-
152-
Outputs:
153-
154-
Purpose:
155-
156-
\*******************************************************************/
157-
158-
void message_clientt::set_message_handler(
159-
message_handlert &_message_handler)
160-
{
161-
message_handler=&_message_handler;
162103
}

0 commit comments

Comments
 (0)