Skip to content

Commit 461754d

Browse files
committed
Remove unused parameters in goto-instrument/wmm
1 parent 7c1de91 commit 461754d

11 files changed

+19
-39
lines changed

src/goto-instrument/goto_instrument_parse_options.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -1245,9 +1245,6 @@ void goto_instrument_parse_optionst::instrument_goto_program()
12451245
/* default: instruments all unsafe pairs */
12461246
inst_strategy=all;
12471247

1248-
const unsigned unwind_loops=
1249-
cmdline.isset("unwind")?
1250-
unsafe_string2unsigned(cmdline.get_value("unwind")):0;
12511248
const unsigned max_var=
12521249
cmdline.isset("max-var")?
12531250
unsafe_string2unsigned(cmdline.get_value("max-var")):0;
@@ -1295,7 +1292,6 @@ void goto_instrument_parse_optionst::instrument_goto_program()
12951292
goto_model,
12961293
cmdline.isset("scc"),
12971294
inst_strategy,
1298-
unwind_loops,
12991295
!cmdline.isset("cfg-kill"),
13001296
cmdline.isset("no-dependencies"),
13011297
loops,

src/goto-instrument/wmm/event_graph.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,7 @@ std::string event_grapht::critical_cyclet::print_output() const
10981098
std::string event_grapht::critical_cyclet::print_detail(
10991099
const critical_cyclet &reduced,
11001100
std::map<std::string, std::string> &map_id2var,
1101-
std::map<std::string, std::string> &map_var2id,
1102-
memory_modelt model) const
1101+
std::map<std::string, std::string> &map_var2id) const
11031102
{
11041103
std::string cycle;
11051104
for(const_iterator it=reduced.begin(); it!=reduced.end(); ++it)
@@ -1140,13 +1139,13 @@ std::string event_grapht::critical_cyclet::print_all(
11401139
critical_cyclet reduced(egraph, id);
11411140
this->hide_internals(reduced);
11421141
assert(reduced.size() > 0);
1143-
cycle+=print_detail(reduced, map_id2var, map_var2id, model);
1142+
cycle+=print_detail(reduced, map_id2var, map_var2id);
11441143
cycle+=": ";
11451144
cycle+=print_name(reduced, model);
11461145
}
11471146
else
11481147
{
1149-
cycle+=print_detail(*this, map_id2var, map_var2id, model);
1148+
cycle+=print_detail(*this, map_id2var, map_var2id);
11501149
cycle+=": ";
11511150
cycle+=print_name(*this, model);
11521151
}

src/goto-instrument/wmm/event_graph.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class event_grapht
4848

4949
std::string print_detail(const critical_cyclet &reduced,
5050
std::map<std::string, std::string> &map_id2var,
51-
std::map<std::string, std::string> &map_var2id,
52-
memory_modelt model) const;
51+
std::map<std::string, std::string> &map_var2id) const;
5352
std::string print_name(const critical_cyclet &redyced,
5453
memory_modelt model) const;
5554

@@ -377,7 +376,7 @@ class event_grapht
377376
{}
378377

379378
void set_naive() {naive=true;}
380-
void collect_pairs(namespacet &ns);
379+
void collect_pairs();
381380
};
382381

383382
public:
@@ -577,17 +576,17 @@ class event_grapht
577576

578577
/* collects all the pairs of events with respectively at least one cmp,
579578
regardless of the architecture (Pensieve'05 strategy) */
580-
void collect_pairs(namespacet &ns)
579+
void collect_pairs()
581580
{
582581
graph_pensieve_explorert exploration(*this, max_var, max_po_trans);
583-
exploration.collect_pairs(ns);
582+
exploration.collect_pairs();
584583
}
585584

586-
void collect_pairs_naive(namespacet &ns)
585+
void collect_pairs_naive()
587586
{
588587
graph_pensieve_explorert exploration(*this, max_var, max_po_trans);
589588
exploration.set_naive();
590-
exploration.collect_pairs(ns);
589+
exploration.collect_pairs();
591590
}
592591
};
593592
#endif // CPROVER_GOTO_INSTRUMENT_WMM_EVENT_GRAPH_H

src/goto-instrument/wmm/goto2graph.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ void instrumentert::cfg_visitort::visit_cfg_function(
152152
loop_strategyt replicate_body,
153153
/* function to analyse */
154154
const irep_idt &function,
155-
/* incoming edges */
156-
const std::set<instrumentert::cfg_visitort::nodet> &initial_vertex,
157155
/* outcoming edges */
158156
std::set<instrumentert::cfg_visitort::nodet> &ending_vertex)
159157
{
@@ -657,11 +655,6 @@ void instrumentert::cfg_visitort::visit_cfg_function_call(
657655
loop_strategyt replicate_body)
658656
{
659657
const goto_programt::instructiont &instruction=*i_it;
660-
std::set<nodet> s;
661-
for(const auto &in : instruction.incoming_edges)
662-
if(in_pos.find(in)!=in_pos.end())
663-
for(const auto &node : in_pos[in])
664-
s.insert(node);
665658

666659
const exprt &fun=to_code_function_call(instruction.code).function();
667660
const irep_idt &fun_id=to_symbol_expr(fun).get_identifier();
@@ -689,7 +682,7 @@ void instrumentert::cfg_visitort::visit_cfg_function_call(
689682
{
690683
/* just inlines */
691684
/* TODO */
692-
visit_cfg_function(value_sets, model, no_dependencies, fun_id, s,
685+
visit_cfg_function(value_sets, model, no_dependencies, fun_id,
693686
in_pos[i_it]);
694687
updated.insert(i_it);
695688
}
@@ -699,7 +692,7 @@ void instrumentert::cfg_visitort::visit_cfg_function_call(
699692
{
700693
/* normal inlining strategy */
701694
visit_cfg_function(value_sets, model, no_dependencies, replicate_body,
702-
fun_id, s, in_pos[i_it]);
695+
fun_id, in_pos[i_it]);
703696
updated.insert(i_it);
704697
}
705698

src/goto-instrument/wmm/goto2graph.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,9 @@ class instrumentert
245245
{
246246
/* forbids recursive function */
247247
enter_function(function);
248-
const std::set<nodet> empty_in;
249248
std::set<nodet> end_out;
250249
visit_cfg_function(value_sets, model, no_dependencies, duplicate_body,
251-
function, empty_in, end_out);
250+
function, end_out);
252251
leave_function(function);
253252
}
254253
catch(const std::string &s)
@@ -266,8 +265,6 @@ class instrumentert
266265
loop_strategyt duplicate_body,
267266
/// function to analyse
268267
const irep_idt &function,
269-
/// incoming edges
270-
const std::set<nodet> &initial_vertex,
271268
/// outcoming edges
272269
std::set<nodet> &ending_vertex);
273270

src/goto-instrument/wmm/instrumenter_pensieve.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class instrumenter_pensievet:public instrumentert
2626
{
2727
}
2828

29-
void collect_pairs_naive(namespacet &ns)
29+
void collect_pairs_naive()
3030
{
31-
egraph.collect_pairs_naive(ns);
31+
egraph.collect_pairs_naive();
3232
}
3333

3434
/* collects directly all the pairs in the graph */
35-
void collect_pairs(namespacet &ns)
35+
void collect_pairs()
3636
{
37-
egraph.collect_pairs(ns);
37+
egraph.collect_pairs();
3838
}
3939
};
4040

src/goto-instrument/wmm/pair_collection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Date: 2013
2222
#define OUTPUT(s, fence, file, line, id, type) \
2323
s<<fence<<"|"<<file<<"|"<<line<<"|"<<id<<"|"<<type<<'\n'
2424

25-
void event_grapht::graph_pensieve_explorert::collect_pairs(namespacet &ns)
25+
void event_grapht::graph_pensieve_explorert::collect_pairs()
2626
{
2727
std::ofstream res;
2828
res.open("results.txt");

src/goto-instrument/wmm/shared_buffers.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,10 @@ bool shared_bufferst::is_buffered(
970970
if(instrumentations.find(identifier)!=instrumentations.end())
971971
return false; // these are instrumentations
972972

973-
return is_buffered_in_general(ns, symbol_expr, is_write);
973+
return is_buffered_in_general(symbol_expr, is_write);
974974
}
975975

976976
bool shared_bufferst::is_buffered_in_general(
977-
const namespacet &ns,
978977
const symbol_exprt &symbol_expr,
979978
bool is_write
980979
// are we asking for the variable (false), or for the variable and the
@@ -1042,7 +1041,7 @@ void shared_bufferst::affected_by_delay(
10421041
message.debug() <<"debug: "<<id2string(w_it->second.object)
10431042
<<" reads from "<<id2string(r_it->second.object)
10441043
<<messaget::eom;
1045-
if(is_buffered_in_general(ns, r_it->second.symbol_expr, true))
1044+
if(is_buffered_in_general(r_it->second.symbol_expr, true))
10461045
// shouldn't it be true? false => overapprox
10471046
affected_by_delay_set.insert(w_it->second.object);
10481047
}

src/goto-instrument/wmm/shared_buffers.h

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ class shared_bufferst
173173
bool is_write);
174174

175175
bool is_buffered_in_general(
176-
const namespacet&,
177176
const symbol_exprt&,
178177
bool is_write);
179178

src/goto-instrument/wmm/weak_memory.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ void weak_memory(
107107
goto_modelt &goto_model,
108108
bool SCC,
109109
instrumentation_strategyt event_strategy,
110-
unsigned unwinding_bound,
111110
bool no_cfg_kill,
112111
bool no_dependencies,
113112
loop_strategyt duplicate_body,

src/goto-instrument/wmm/weak_memory.h

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ void weak_memory(
3131
goto_modelt &,
3232
bool SCC,
3333
instrumentation_strategyt event_stategy,
34-
unsigned unwinding_bound,
3534
bool no_cfg_kill,
3635
bool no_dependencies,
3736
loop_strategyt duplicate_body,

0 commit comments

Comments
 (0)