Skip to content

Commit 75eda5a

Browse files
author
Daniel Kroening
committed
dependence graph now tracks a function identifier
1 parent 026418f commit 75eda5a

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/analyses/dependence_graph.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ bool dep_graph_domaint::merge(
5353
}
5454

5555
void dep_graph_domaint::control_dependencies(
56+
const irep_idt &function_identifier,
5657
goto_programt::const_targett from,
5758
goto_programt::const_targett to,
5859
dependence_grapht &dep_graph)
@@ -83,7 +84,7 @@ void dep_graph_domaint::control_dependencies(
8384

8485
// Get postdominators
8586

86-
const irep_idt id=from->function;
87+
const irep_idt id=function_identifier;
8788
const cfg_post_dominatorst &pd=dep_graph.cfg_post_dominators().at(id);
8889

8990
// Check all candidates
@@ -206,7 +207,7 @@ void dep_graph_domaint::transform(
206207
{
207208
if(function_from == function_to)
208209
{
209-
control_dependencies(from, to, *dep_graph);
210+
control_dependencies(function_from, from, to, *dep_graph);
210211
}
211212
else
212213
{
@@ -232,7 +233,7 @@ void dep_graph_domaint::transform(
232233
}
233234
}
234235
else
235-
control_dependencies(from, to, *dep_graph);
236+
control_dependencies(function_from, from, to, *dep_graph);
236237

237238
data_dependencies(from, to, *dep_graph, ns);
238239
}

src/analyses/dependence_graph.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class dep_graph_domaint:public ai_domain_baset
203203
dependence_graph_test_get_data_deps(const dep_graph_domaint &);
204204

205205
void control_dependencies(
206+
const irep_idt &function_identifier,
206207
goto_programt::const_targett from,
207208
goto_programt::const_targett to,
208209
dependence_grapht &dep_graph);
@@ -236,18 +237,6 @@ class dependence_grapht:
236237
rd(goto_functions, ns);
237238
}
238239

239-
void initialize(const goto_programt &goto_program)
240-
{
241-
ait<dep_graph_domaint>::initialize(goto_program);
242-
243-
if(!goto_program.empty())
244-
{
245-
const irep_idt id=goto_programt::get_function_id(goto_program);
246-
cfg_post_dominatorst &pd=post_dominators[id];
247-
pd(goto_program);
248-
}
249-
}
250-
251240
void finalize()
252241
{
253242
for(const auto &location_state : state_map)

0 commit comments

Comments
 (0)