File tree Expand file tree Collapse file tree 4 files changed +38
-5
lines changed
regression/goto-instrument/dependence-graph1 Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Original file line number Diff line number Diff line change
1
+
2
+ int x ;
3
+
4
+ void func ()
5
+ {
6
+ int r ;
7
+
8
+ r = x ;
9
+ }
10
+
11
+ int main ()
12
+ {
13
+ x = 1 ;
14
+ func ();
15
+
16
+ return 0 ;
17
+ }
18
+
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --show-dependence-graph
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -499,10 +499,11 @@ void ai_baset::sequential_fixedpoint(
499
499
const goto_functionst &goto_functions,
500
500
const namespacet &ns)
501
501
{
502
- // do each function at least once
502
+ goto_functionst::function_mapt::const_iterator
503
+ f_it=goto_functions.function_map .find (goto_functions.entry_point ());
503
504
504
- forall_goto_functions (it, goto_functions)
505
- fixedpoint (it ->second .body , goto_functions, ns);
505
+ if (f_it!= goto_functions. function_map . end () )
506
+ fixedpoint (f_it ->second .body , goto_functions, ns);
506
507
}
507
508
508
509
/* ******************************************************************\
Original file line number Diff line number Diff line change @@ -94,14 +94,20 @@ class dep_graph_domaint:public ai_domain_baset
94
94
95
95
void make_top () final override
96
96
{
97
+ assert (node_id!=std::numeric_limits<node_indext>::max ());
98
+
97
99
has_values=tvt (true );
98
- node_id=std::numeric_limits<node_indext>::max ();
100
+ control_deps.clear ();
101
+ data_deps.clear ();
99
102
}
100
103
101
104
void make_bottom () final override
102
105
{
106
+ assert (node_id!=std::numeric_limits<node_indext>::max ());
107
+
103
108
has_values=tvt (false );
104
- node_id=std::numeric_limits<node_indext>::max ();
109
+ control_deps.clear ();
110
+ data_deps.clear ();
105
111
}
106
112
107
113
void make_entry () final override
@@ -161,6 +167,7 @@ class dependence_grapht:
161
167
162
168
void initialize (const goto_programt &goto_program)
163
169
{
170
+ ait<dep_graph_domaint>::initialize (goto_program);
164
171
post_dominators (goto_program);
165
172
}
166
173
You can’t perform that action at this time.
0 commit comments