@@ -45,7 +45,7 @@ void event_grapht::graph_explorert::filter_thin_air(
4545 }
4646
4747#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 ();
4949 it!=thin_air_events.end ();
5050 ++it)
5151 egraph.message .debug ()<<egraph[*it]<<" ;" ;
@@ -71,10 +71,10 @@ void event_grapht::graph_explorert::collect_cycles(
7171 memory_modelt model)
7272{
7373 /* 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++)
7575 mark[i] = false ;
7676
77- std::list<unsigned >* order=0 ;
77+ std::list<event_idt >* order=0 ;
7878 /* on Power, rfe pairs are also potentially unsafe */
7979 switch (model)
8080 {
@@ -100,17 +100,19 @@ void event_grapht::graph_explorert::collect_cycles(
100100 if (order->empty ())
101101 return ;
102102
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)
105107 {
106- unsigned source=*st_it;
108+ event_idt source=*st_it;
107109 egraph.message .debug () << " explore " << egraph[source].id << messaget::eom;
108110 backtrack (set_of_cycles, source, source,
109111 false , max_po_trans, false , false , false , " " , model);
110112
111113 while (!marked_stack.empty ())
112114 {
113- unsigned up=marked_stack.top ();
115+ event_idt up=marked_stack.top ();
114116 mark[up]=false ;
115117 marked_stack.pop ();
116118 }
@@ -136,17 +138,17 @@ Function: event_grapht::graph_explorert::extract_cycle
136138\*******************************************************************/
137139
138140event_grapht::critical_cyclet event_grapht::graph_explorert::extract_cycle (
139- unsigned vertex,
140- unsigned source,
141+ event_idt vertex,
142+ event_idt source,
141143 unsigned number)
142144{
143145 critical_cyclet new_cycle (egraph, number);
144146 bool incycle=false ;
145- std::stack<unsigned > stack (point_stack);
147+ std::stack<event_idt > stack (point_stack);
146148
147149 while (!stack.empty ())
148150 {
149- unsigned current_vertex=stack.top ();
151+ event_idt current_vertex=stack.top ();
150152 stack.pop ();
151153
152154 egraph.message .debug () << " extract: " << egraph[current_vertex].get_operation ()
@@ -186,22 +188,22 @@ Function: event_grapht::graph_explorert::backtrack
186188
187189bool event_grapht::graph_explorert::backtrack (
188190 std::set<critical_cyclet> &set_of_cycles,
189- unsigned source,
190- unsigned vertex,
191+ event_idt source,
192+ event_idt vertex,
191193 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 */
193195 bool same_var_pair, /* in a thread, tells if we already met one rfi wsi fri */
194196 bool lwfence_met, /* if we try to skip a lwsync (only valid for lwsyncWR) */
195197 bool has_to_be_unsafe,
196198 irep_idt var_to_avoid,
197199 memory_modelt model)
198200{
199201#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);
201203 egraph.message .debug () << messaget::eom;
202204 egraph.message .debug () << " marked size:" << marked_stack.size ()
203205 << messaget::eom;
204- std::stack<unsigned > tmp;
206+ std::stack<event_idt > tmp;
205207 while (!point_stack.empty ())
206208 {
207209 egraph.message .debug () << point_stack.top () << " | " ;
@@ -286,9 +288,9 @@ bool event_grapht::graph_explorert::backtrack(
286288 re-order also the two writes, which is not permitted on TSO. */
287289 if (has_to_be_unsafe && point_stack.size () >= 2 )
288290 {
289- const unsigned previous = point_stack.top ();
291+ const event_idt previous = point_stack.top ();
290292 point_stack.pop ();
291- const unsigned preprevious = point_stack.top ();
293+ const event_idt preprevious = point_stack.top ();
292294 point_stack.push (previous);
293295 if (!egraph[preprevious].unsafe_pair (this_vertex,model)
294296 && !(this_vertex.operation ==abstract_eventt::Fence
@@ -397,7 +399,7 @@ bool event_grapht::graph_explorert::backtrack(
397399 w_it=egraph.po_out (vertex).begin ();
398400 w_it!=egraph.po_out (vertex).end (); w_it++)
399401 {
400- const unsigned w = w_it->first ;
402+ const event_idt w = w_it->first ;
401403 if (w == source && point_stack.size ()>=4
402404 && (unsafe_met_updated
403405 || this_vertex.unsafe_pair (egraph[source],model)) )
@@ -440,7 +442,7 @@ bool event_grapht::graph_explorert::backtrack(
440442 w_it=egraph.com_out (vertex).begin ();
441443 w_it!=egraph.com_out (vertex).end (); w_it++)
442444 {
443- const unsigned w = w_it->first ;
445+ const event_idt w = w_it->first ;
444446 if (w < source)
445447 egraph.remove_com_edge (vertex,w);
446448 else if (w == source && point_stack.size ()>=4
@@ -481,7 +483,7 @@ bool event_grapht::graph_explorert::backtrack(
481483 {
482484 while (!marked_stack.empty () && marked_stack.top ()!=vertex)
483485 {
484- unsigned up = marked_stack.top ();
486+ event_idt up = marked_stack.top ();
485487 marked_stack.pop ();
486488 mark[up] = false ;
487489 }
@@ -526,7 +528,7 @@ bool event_grapht::graph_explorert::backtrack(
526528 {
527529 skip_tracked.insert (vertex);
528530
529- std::stack<unsigned > tmp;
531+ std::stack<event_idt > tmp;
530532
531533 while (marked_stack.size ()>0 && marked_stack.top ()!=vertex)
532534 {
@@ -572,7 +574,7 @@ bool event_grapht::graph_explorert::backtrack(
572574 egraph.po_out (vertex).begin ();
573575 w_it!=egraph.po_out (vertex).end (); w_it++)
574576 {
575- const unsigned w = w_it->first ;
577+ const event_idt w = w_it->first ;
576578 f |= backtrack (set_of_cycles, source, w,
577579 unsafe_met/* _updated*/ , (po_trans==0 ?0 :po_trans-1 ),
578580 same_var_pair/* _updated*/ , is_lwfence, has_to_be_unsafe, avoid_at_the_end,
@@ -583,7 +585,7 @@ bool event_grapht::graph_explorert::backtrack(
583585 {
584586 while (!marked_stack.empty () && marked_stack.top ()!=vertex)
585587 {
586- unsigned up = marked_stack.top ();
588+ event_idt up = marked_stack.top ();
587589 marked_stack.pop ();
588590 mark[up] = false ;
589591 }
0 commit comments