@@ -33,15 +33,15 @@ Function: event_grapht::print_rec_graph
33
33
34
34
\*******************************************************************/
35
35
36
- void event_grapht::print_rec_graph (std::ofstream& file, unsigned node_id,
37
- std::set<unsigned >& visited)
36
+ void event_grapht::print_rec_graph (std::ofstream& file, event_idt node_id,
37
+ std::set<event_idt >& visited)
38
38
{
39
39
const abstract_eventt& node=operator [](node_id);
40
40
file << node_id << " [label=\" " << node << " , " << node.source_location <<
41
41
" \" ];" << std::endl;
42
42
visited.insert (node_id);
43
43
44
- for (graph<abstract_eventt> ::edgest::const_iterator
44
+ for (wmm_grapht ::edgest::const_iterator
45
45
it=po_out (node_id).begin ();
46
46
it!=po_out (node_id).end (); ++it)
47
47
{
@@ -51,7 +51,7 @@ void event_grapht::print_rec_graph(std::ofstream& file, unsigned node_id,
51
51
print_rec_graph (file, it->first , visited);
52
52
}
53
53
54
- for (graph<abstract_eventt> ::edgest::const_iterator
54
+ for (wmm_grapht ::edgest::const_iterator
55
55
it=com_out (node_id).begin ();
56
56
it!=com_out (node_id).end (); ++it)
57
57
{
@@ -75,8 +75,8 @@ Function: event_grapht::print_graph
75
75
76
76
void event_grapht::print_graph () {
77
77
assert (po_order.size ()>0 );
78
- std::set<unsigned > visited;
79
- unsigned root=po_order.front ();
78
+ std::set<event_idt > visited;
79
+ event_idt root=po_order.front ();
80
80
std::ofstream file;
81
81
file.open (" graph.dot" );
82
82
file << " digraph G {" << std::endl;
@@ -98,8 +98,8 @@ Function: event_grapht::copy_segment
98
98
99
99
\*******************************************************************/
100
100
101
- void event_grapht::explore_copy_segment (std::set<unsigned >& explored,
102
- unsigned begin, unsigned end) const
101
+ void event_grapht::explore_copy_segment (std::set<event_idt >& explored,
102
+ event_idt begin, event_idt end) const
103
103
{
104
104
// std::cout << "explores " << begin << " against " << end << std::endl;
105
105
if (explored.find (begin)!=explored.end ())
@@ -110,13 +110,13 @@ void event_grapht::explore_copy_segment(std::set<unsigned>& explored,
110
110
if (begin==end)
111
111
return ;
112
112
113
- for (graph<abstract_eventt> ::edgest::const_iterator it=po_out (begin).begin ();
113
+ for (wmm_grapht ::edgest::const_iterator it=po_out (begin).begin ();
114
114
it!=po_out (begin).end ();
115
115
++it)
116
116
explore_copy_segment (explored, it->first , end);
117
117
}
118
118
119
- unsigned event_grapht::copy_segment (unsigned begin, unsigned end)
119
+ event_idt event_grapht::copy_segment (event_idt begin, event_idt end)
120
120
{
121
121
const abstract_eventt& begin_event=operator [](begin);
122
122
const abstract_eventt& end_event=operator [](end);
@@ -136,25 +136,25 @@ unsigned event_grapht::copy_segment(unsigned begin, unsigned end)
136
136
137
137
message.status () << " tries to duplicate between " << begin_event.source_location
138
138
<< " and " << end_event.source_location << messaget::eom;
139
- std::set<unsigned > covered;
139
+ std::set<event_idt > covered;
140
140
141
141
/* collects the nodes of the subgraph */
142
142
explore_copy_segment (covered, begin, end);
143
143
144
144
if (covered.size ()==0 )
145
145
return end;
146
146
147
- // for(std::set<unsigned >::const_iterator it=covered.begin(); it!=covered.end(); ++it)
147
+ // for(std::set<event_idt >::const_iterator it=covered.begin(); it!=covered.end(); ++it)
148
148
// std::cout << "covered: " << *it << std::endl;
149
149
150
- std::map<unsigned , unsigned > orig2copy;
150
+ std::map<event_idt, event_idt > orig2copy;
151
151
152
152
/* duplicates nodes */
153
- for (std::set<unsigned >::const_iterator it=covered.begin ();
153
+ for (std::set<event_idt >::const_iterator it=covered.begin ();
154
154
it!=covered.end ();
155
155
++it)
156
156
{
157
- const unsigned new_node=add_node ();
157
+ const event_idt new_node=add_node ();
158
158
operator [](new_node)(operator [](*it));
159
159
orig2copy[*it]=new_node;
160
160
}
@@ -164,11 +164,11 @@ unsigned event_grapht::copy_segment(unsigned begin, unsigned end)
164
164
// (working on back-edges...)
165
165
166
166
/* replicates the po_s forward-edges -- O(#E^2) */
167
- for (std::set<unsigned >::const_iterator it_i=covered.begin ();
167
+ for (std::set<event_idt >::const_iterator it_i=covered.begin ();
168
168
it_i!=covered.end ();
169
169
++it_i)
170
170
{
171
- for (std::set<unsigned >::const_iterator it_j=covered.begin ();
171
+ for (std::set<event_idt >::const_iterator it_j=covered.begin ();
172
172
it_j!=covered.end ();
173
173
++it_j)
174
174
{
@@ -186,11 +186,11 @@ unsigned event_grapht::copy_segment(unsigned begin, unsigned end)
186
186
187
187
// TODO: to move to goto2graph, after po_s construction
188
188
/* replicates the cmp-edges -- O(#E x #G) */
189
- for (std::set<unsigned >::const_iterator it_i=covered.begin ();
189
+ for (std::set<event_idt >::const_iterator it_i=covered.begin ();
190
190
it_i!=covered.end ();
191
191
++it_i)
192
192
{
193
- for (unsigned it_j=0 ;
193
+ for (event_idt it_j=0 ;
194
194
it_j<size ();
195
195
++it_j)
196
196
{
@@ -546,8 +546,8 @@ bool event_grapht::critical_cyclet::is_unsafe(memory_modelt model, bool fast)
546
546
if (first.unsafe_pair (second,model)
547
547
&& (first.thread !=second.thread || egraph.are_po_ordered (back (),*s_it)))
548
548
{
549
- std::list<unsigned >::const_iterator before_first;
550
- std::list<unsigned >::const_iterator after_second;
549
+ std::list<event_idt >::const_iterator before_first;
550
+ std::list<event_idt >::const_iterator after_second;
551
551
552
552
before_first = end ();
553
553
--before_first;
@@ -580,8 +580,8 @@ bool event_grapht::critical_cyclet::is_unsafe(memory_modelt model, bool fast)
580
580
if (first.unsafe_pair_lwfence (second,model)
581
581
&& (first.thread !=second.thread || egraph.are_po_ordered (back (),*s_it)))
582
582
{
583
- std::list<unsigned >::const_iterator before_first;
584
- std::list<unsigned >::const_iterator after_second;
583
+ std::list<event_idt >::const_iterator before_first;
584
+ std::list<event_idt >::const_iterator after_second;
585
585
586
586
before_first = end ();
587
587
--before_first;
@@ -1331,7 +1331,7 @@ Function: event_grapht::critical_cyclet::hide_internals
1331
1331
1332
1332
void event_grapht::critical_cyclet::hide_internals (critical_cyclet& reduced) const
1333
1333
{
1334
- std::set<unsigned > reduced_evts;
1334
+ std::set<event_idt > reduced_evts;
1335
1335
const_iterator first_it, prev_it=end ();
1336
1336
1337
1337
/* finds an element first of its thread */
0 commit comments