aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_succ_typings.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-02-15 15:47:46 +0100
committerHenrik Nord <[email protected]>2012-05-21 15:31:16 +0200
commit130465c94d6c56e97dab1c1880435e68e57759c7 (patch)
treebf420449b53017d3aad59ec94416bca2e6ff7a35 /lib/dialyzer/src/dialyzer_succ_typings.erl
parentbceee0662a9f6aac6b0987517498bff2ade144df (diff)
downloadotp-130465c94d6c56e97dab1c1880435e68e57759c7.tar.gz
otp-130465c94d6c56e97dab1c1880435e68e57759c7.tar.bz2
otp-130465c94d6c56e97dab1c1880435e68e57759c7.zip
Flatten order of dataflow analyses
Dataflow analysis was structured to find SCCs of modules, without making any use of the information that these were indeed SCCs.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_succ_typings.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_succ_typings.erl31
1 files changed, 4 insertions, 27 deletions
diff --git a/lib/dialyzer/src/dialyzer_succ_typings.erl b/lib/dialyzer/src/dialyzer_succ_typings.erl
index 5982603b7b..2c2c39951c 100644
--- a/lib/dialyzer/src/dialyzer_succ_typings.erl
+++ b/lib/dialyzer/src/dialyzer_succ_typings.erl
@@ -181,17 +181,13 @@ refine_succ_typings(ModulePostorder, State) ->
?debug("Module postorder: ~p\n", [ModulePostorder]),
refine_succ_typings(ModulePostorder, State, []).
-refine_succ_typings([SCC|SCCs], State, Fixpoint) ->
- Msg = io_lib:format("Dataflow of one SCC: ~w\n", [SCC]),
+refine_succ_typings([M|Rest], State, Fixpoint) ->
+ Msg = io_lib:format("Dataflow of module: ~w\n", [M]),
send_log(State#st.parent, Msg),
?debug("~s\n", [Msg]),
- {NewState, FixpointFromScc} =
- case SCC of
- [M] -> refine_one_module(M, State);
- [_|_] -> refine_one_scc(SCC, State)
- end,
+ {NewState, FixpointFromScc} = refine_one_module(M, State),
NewFixpoint = ordsets:union(Fixpoint, FixpointFromScc),
- refine_succ_typings(SCCs, NewState, NewFixpoint);
+ refine_succ_typings(Rest, NewState, NewFixpoint);
refine_succ_typings([], State, Fixpoint) ->
case Fixpoint =:= [] of
true -> {fixpoint, State};
@@ -225,25 +221,6 @@ refine_one_module(M, State) ->
st__renew_state_calls(Callgraph, State) ->
State#st{callgraph = Callgraph}.
-refine_one_scc(SCC, State) ->
- refine_one_scc(SCC, State, []).
-
-refine_one_scc(SCC, State, AccFixpoint) ->
- {NewState, FixpointFromScc} = refine_mods_in_scc(SCC, State, []),
- case FixpointFromScc =:= [] of
- true -> {NewState, AccFixpoint};
- false ->
- NewAccFixpoint = ordsets:union(AccFixpoint, FixpointFromScc),
- refine_one_scc(SCC, NewState, NewAccFixpoint)
- end.
-
-refine_mods_in_scc([Mod|Mods], State, Fixpoint) ->
- {NewState, FixpointFromModule} = refine_one_module(Mod, State),
- NewFixpoint = ordsets:union(FixpointFromModule, Fixpoint),
- refine_mods_in_scc(Mods, NewState, NewFixpoint);
-refine_mods_in_scc([], State, Fixpoint) ->
- {State, Fixpoint}.
-
reached_fixpoint(OldTypes, NewTypes) ->
reached_fixpoint(OldTypes, NewTypes, false).