Skip to content

Commit 59c8e95

Browse files
authored
Merge pull request #5586 from tautschnig/messaget-partial_order_concurrency
partial_order_concurrencyt isn't a messaget
2 parents 7c016a7 + 44ee608 commit 59c8e95

10 files changed

+30
-23
lines changed

src/goto-checker/bmc_util.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ void postprocess_equation(
330330
{
331331
std::unique_ptr<memory_model_baset> memory_model =
332332
get_memory_model(options, ns);
333-
memory_model->set_message_handler(ui_message_handler);
334-
(*memory_model)(equation);
333+
(*memory_model)(equation, ui_message_handler);
335334
}
336335

337336
messaget log(ui_message_handler);

src/goto-symex/memory_model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class memory_model_baset : public partial_order_concurrencyt
2020
explicit memory_model_baset(const namespacet &_ns);
2121
virtual ~memory_model_baset();
2222

23-
virtual void operator()(symex_target_equationt &) = 0;
23+
virtual void operator()(symex_target_equationt &, message_handlert &) = 0;
2424

2525
protected:
2626
/// In-thread program order

src/goto-symex/memory_model_pso.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ Author: Michael Tautschnig, [email protected]
1111

1212
#include "memory_model_pso.h"
1313

14-
void memory_model_psot::operator()(symex_target_equationt &equation)
14+
void memory_model_psot::
15+
operator()(symex_target_equationt &equation, message_handlert &message_handler)
1516
{
16-
statistics() << "Adding PSO constraints" << eom;
17+
messaget log{message_handler};
18+
log.statistics() << "Adding PSO constraints" << messaget::eom;
1719

18-
build_event_lists(equation);
20+
build_event_lists(equation, message_handler);
1921
build_clock_type();
2022

2123
read_from(equation);

src/goto-symex/memory_model_pso.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class memory_model_psot:public memory_model_tsot
2222
{
2323
}
2424

25-
virtual void operator()(symex_target_equationt &equation);
25+
virtual void operator()(symex_target_equationt &equation, message_handlert &);
2626

2727
protected:
2828
virtual bool program_order_is_relaxed(

src/goto-symex/memory_model_sc.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ Author: Michael Tautschnig, [email protected]
1313

1414
#include <util/std_expr.h>
1515

16-
void memory_model_sct::operator()(symex_target_equationt &equation)
16+
void memory_model_sct::
17+
operator()(symex_target_equationt &equation, message_handlert &message_handler)
1718
{
18-
statistics() << "Adding SC constraints" << eom;
19+
messaget log{message_handler};
20+
log.statistics() << "Adding SC constraints" << messaget::eom;
1921

20-
build_event_lists(equation);
22+
build_event_lists(equation, message_handler);
2123
build_clock_type();
2224

2325
read_from(equation);

src/goto-symex/memory_model_sc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class memory_model_sct:public memory_model_baset
2222
{
2323
}
2424

25-
virtual void operator()(symex_target_equationt &equation);
25+
virtual void operator()(symex_target_equationt &equation, message_handlert &);
2626

2727
protected:
2828
virtual exprt before(event_it e1, event_it e2);

src/goto-symex/memory_model_tso.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ Author: Michael Tautschnig, [email protected]
1414
#include <util/std_expr.h>
1515
#include <util/simplify_expr.h>
1616

17-
void memory_model_tsot::operator()(symex_target_equationt &equation)
17+
void memory_model_tsot::
18+
operator()(symex_target_equationt &equation, message_handlert &message_handler)
1819
{
19-
statistics() << "Adding TSO constraints" << eom;
20+
messaget log{message_handler};
21+
log.statistics() << "Adding TSO constraints" << messaget::eom;
2022

21-
build_event_lists(equation);
23+
build_event_lists(equation, message_handler);
2224
build_clock_type();
2325

2426
read_from(equation);

src/goto-symex/memory_model_tso.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class memory_model_tsot:public memory_model_sct
2222
{
2323
}
2424

25-
virtual void operator()(symex_target_equationt &equation);
25+
virtual void operator()(symex_target_equationt &equation, message_handlert &);
2626

2727
protected:
2828
virtual exprt before(event_it e1, event_it e2);

src/goto-symex/partial_order_concurrency.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ void partial_order_concurrencyt::add_init_writes(
7373
}
7474

7575
void partial_order_concurrencyt::build_event_lists(
76-
symex_target_equationt &equation)
76+
symex_target_equationt &equation,
77+
message_handlert &message_handler)
7778
{
7879
add_init_writes(equation);
7980

@@ -107,6 +108,7 @@ void partial_order_concurrencyt::build_event_lists(
107108
}
108109
}
109110

111+
messaget log{message_handler};
110112
for(address_mapt::const_iterator
111113
a_it=address_map.begin();
112114
a_it!=address_map.end();
@@ -116,9 +118,8 @@ void partial_order_concurrencyt::build_event_lists(
116118
if(a_rec.reads.empty())
117119
continue;
118120

119-
statistics() << "Shared " << a_it->first << ": "
120-
<< a_rec.reads.size() << "R/"
121-
<< a_rec.writes.size() << "W" << eom;
121+
log.statistics() << "Shared " << a_it->first << ": " << a_rec.reads.size()
122+
<< "R/" << a_rec.writes.size() << "W" << messaget::eom;
122123
}
123124
}
124125

src/goto-symex/partial_order_concurrency.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ Author: Michael Tautschnig, [email protected]
1212
#ifndef CPROVER_GOTO_SYMEX_PARTIAL_ORDER_CONCURRENCY_H
1313
#define CPROVER_GOTO_SYMEX_PARTIAL_ORDER_CONCURRENCY_H
1414

15-
#include <util/message.h>
16-
1715
#include "symex_target_equation.h"
1816

1917
/// Base class for implementing memory models via additional constraints for
2018
/// SSA equations. Provides methods for encoding ordering of shared read/write
2119
/// events.
22-
class partial_order_concurrencyt:public messaget
20+
class partial_order_concurrencyt
2321
{
2422
public:
2523
explicit partial_order_concurrencyt(const namespacet &_ns);
@@ -67,7 +65,10 @@ class partial_order_concurrencyt:public messaget
6765
/// 2) the _numbering_ map (with per-thread unique number of every event)
6866
/// \param equation: the target equation (containing the events to be
6967
/// processed)
70-
void build_event_lists(symex_target_equationt &);
68+
/// \param message_handler: message handler to output statistics
69+
void build_event_lists(
70+
symex_target_equationt &equation,
71+
message_handlert &message_handler);
7172

7273
/// For each shared read event and for each shared write event that appears
7374
/// after spawn or has false _guard_ prepend a shared write SSA step with

0 commit comments

Comments
 (0)