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