@@ -45,7 +45,7 @@ void event_grapht::graph_explorert::filter_thin_air(
45
45
}
46
46
47
47
#ifdef DEBUG
48
- for (std::set<unsigned >::const_iterator it=thin_air_events.begin ();
48
+ for (std::set<event_idt >::const_iterator it=thin_air_events.begin ();
49
49
it!=thin_air_events.end ();
50
50
++it)
51
51
egraph.message .debug ()<<egraph[*it]<<" ;" ;
@@ -71,10 +71,10 @@ void event_grapht::graph_explorert::collect_cycles(
71
71
memory_modelt model)
72
72
{
73
73
/* all the events initially unmarked */
74
- for (unsigned i = 0 ; i<egraph.size (); i++)
74
+ for (std:: size_t i = 0 ; i<egraph.size (); i++)
75
75
mark[i] = false ;
76
76
77
- std::list<unsigned >* order=0 ;
77
+ std::list<event_idt >* order=0 ;
78
78
/* on Power, rfe pairs are also potentially unsafe */
79
79
switch (model)
80
80
{
@@ -100,17 +100,19 @@ void event_grapht::graph_explorert::collect_cycles(
100
100
if (order->empty ())
101
101
return ;
102
102
103
- for (std::list<unsigned >::const_iterator st_it=order->begin ();
104
- st_it!=order->end (); ++st_it)
103
+ for (std::list<event_idt>::const_iterator
104
+ st_it=order->begin ();
105
+ st_it!=order->end ();
106
+ ++st_it)
105
107
{
106
- unsigned source=*st_it;
108
+ event_idt source=*st_it;
107
109
egraph.message .debug () << " explore " << egraph[source].id << messaget::eom;
108
110
backtrack (set_of_cycles, source, source,
109
111
false , max_po_trans, false , false , false , " " , model);
110
112
111
113
while (!marked_stack.empty ())
112
114
{
113
- unsigned up=marked_stack.top ();
115
+ event_idt up=marked_stack.top ();
114
116
mark[up]=false ;
115
117
marked_stack.pop ();
116
118
}
@@ -136,17 +138,17 @@ Function: event_grapht::graph_explorert::extract_cycle
136
138
\*******************************************************************/
137
139
138
140
event_grapht::critical_cyclet event_grapht::graph_explorert::extract_cycle (
139
- unsigned vertex,
140
- unsigned source,
141
+ event_idt vertex,
142
+ event_idt source,
141
143
unsigned number)
142
144
{
143
145
critical_cyclet new_cycle (egraph, number);
144
146
bool incycle=false ;
145
- std::stack<unsigned > stack (point_stack);
147
+ std::stack<event_idt > stack (point_stack);
146
148
147
149
while (!stack.empty ())
148
150
{
149
- unsigned current_vertex=stack.top ();
151
+ event_idt current_vertex=stack.top ();
150
152
stack.pop ();
151
153
152
154
egraph.message .debug () << " extract: " << egraph[current_vertex].get_operation ()
@@ -186,22 +188,22 @@ Function: event_grapht::graph_explorert::backtrack
186
188
187
189
bool event_grapht::graph_explorert::backtrack (
188
190
std::set<critical_cyclet> &set_of_cycles,
189
- unsigned source,
190
- unsigned vertex,
191
+ event_idt source,
192
+ event_idt vertex,
191
193
bool unsafe_met, /* unsafe pair for the model met in the visited path */
192
- unsigned po_trans, /* po-transition skips still allowed */
194
+ event_idt po_trans, /* po-transition skips still allowed */
193
195
bool same_var_pair, /* in a thread, tells if we already met one rfi wsi fri */
194
196
bool lwfence_met, /* if we try to skip a lwsync (only valid for lwsyncWR) */
195
197
bool has_to_be_unsafe,
196
198
irep_idt var_to_avoid,
197
199
memory_modelt model)
198
200
{
199
201
#ifdef DEBUG
200
- for (unsigned i=0 ; i<80 ; egraph.message .debug () << " -" , ++i);
202
+ for (std:: size_t i=0 ; i<80 ; egraph.message .debug () << " -" , ++i);
201
203
egraph.message .debug () << messaget::eom;
202
204
egraph.message .debug () << " marked size:" << marked_stack.size ()
203
205
<< messaget::eom;
204
- std::stack<unsigned > tmp;
206
+ std::stack<event_idt > tmp;
205
207
while (!point_stack.empty ())
206
208
{
207
209
egraph.message .debug () << point_stack.top () << " | " ;
@@ -286,9 +288,9 @@ bool event_grapht::graph_explorert::backtrack(
286
288
re-order also the two writes, which is not permitted on TSO. */
287
289
if (has_to_be_unsafe && point_stack.size () >= 2 )
288
290
{
289
- const unsigned previous = point_stack.top ();
291
+ const event_idt previous = point_stack.top ();
290
292
point_stack.pop ();
291
- const unsigned preprevious = point_stack.top ();
293
+ const event_idt preprevious = point_stack.top ();
292
294
point_stack.push (previous);
293
295
if (!egraph[preprevious].unsafe_pair (this_vertex,model)
294
296
&& !(this_vertex.operation ==abstract_eventt::Fence
@@ -397,7 +399,7 @@ bool event_grapht::graph_explorert::backtrack(
397
399
w_it=egraph.po_out (vertex).begin ();
398
400
w_it!=egraph.po_out (vertex).end (); w_it++)
399
401
{
400
- const unsigned w = w_it->first ;
402
+ const event_idt w = w_it->first ;
401
403
if (w == source && point_stack.size ()>=4
402
404
&& (unsafe_met_updated
403
405
|| this_vertex.unsafe_pair (egraph[source],model)) )
@@ -440,7 +442,7 @@ bool event_grapht::graph_explorert::backtrack(
440
442
w_it=egraph.com_out (vertex).begin ();
441
443
w_it!=egraph.com_out (vertex).end (); w_it++)
442
444
{
443
- const unsigned w = w_it->first ;
445
+ const event_idt w = w_it->first ;
444
446
if (w < source)
445
447
egraph.remove_com_edge (vertex,w);
446
448
else if (w == source && point_stack.size ()>=4
@@ -481,7 +483,7 @@ bool event_grapht::graph_explorert::backtrack(
481
483
{
482
484
while (!marked_stack.empty () && marked_stack.top ()!=vertex)
483
485
{
484
- unsigned up = marked_stack.top ();
486
+ event_idt up = marked_stack.top ();
485
487
marked_stack.pop ();
486
488
mark[up] = false ;
487
489
}
@@ -526,7 +528,7 @@ bool event_grapht::graph_explorert::backtrack(
526
528
{
527
529
skip_tracked.insert (vertex);
528
530
529
- std::stack<unsigned > tmp;
531
+ std::stack<event_idt > tmp;
530
532
531
533
while (marked_stack.size ()>0 && marked_stack.top ()!=vertex)
532
534
{
@@ -572,7 +574,7 @@ bool event_grapht::graph_explorert::backtrack(
572
574
egraph.po_out (vertex).begin ();
573
575
w_it!=egraph.po_out (vertex).end (); w_it++)
574
576
{
575
- const unsigned w = w_it->first ;
577
+ const event_idt w = w_it->first ;
576
578
f |= backtrack (set_of_cycles, source, w,
577
579
unsafe_met/* _updated*/ , (po_trans==0 ?0 :po_trans-1 ),
578
580
same_var_pair/* _updated*/ , is_lwfence, has_to_be_unsafe, avoid_at_the_end,
@@ -583,7 +585,7 @@ bool event_grapht::graph_explorert::backtrack(
583
585
{
584
586
while (!marked_stack.empty () && marked_stack.top ()!=vertex)
585
587
{
586
- unsigned up = marked_stack.top ();
588
+ event_idt up = marked_stack.top ();
587
589
marked_stack.pop ();
588
590
mark[up] = false ;
589
591
}
0 commit comments