aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_succ_typings.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-01-25 15:42:49 +0100
committerStavros Aronis <[email protected]>2012-02-22 14:13:19 +0100
commitbda48b93fc15a718a3bec1f0c8e628d67f486c40 (patch)
tree85ccd30d98fdaf82542c9eb890883ecf0c063e14 /lib/dialyzer/src/dialyzer_succ_typings.erl
parent7a99d71dd3f003bc6179bb69569ece27b38b57eb (diff)
downloadotp-bda48b93fc15a718a3bec1f0c8e628d67f486c40.tar.gz
otp-bda48b93fc15a718a3bec1f0c8e628d67f486c40.tar.bz2
otp-bda48b93fc15a718a3bec1f0c8e628d67f486c40.zip
Simplify dialyzer_succ_typings code
Diffstat (limited to 'lib/dialyzer/src/dialyzer_succ_typings.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_succ_typings.erl13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/dialyzer/src/dialyzer_succ_typings.erl b/lib/dialyzer/src/dialyzer_succ_typings.erl
index 4d86bb34a7..3d21452a63 100644
--- a/lib/dialyzer/src/dialyzer_succ_typings.erl
+++ b/lib/dialyzer/src/dialyzer_succ_typings.erl
@@ -330,23 +330,20 @@ analyze_scc(SCC, #st{codeserver = Codeserver} = State) ->
|| {_, _, _} = MFA <- SCC],
Contracts2 = [{MFA, Contract} || {MFA, {ok, Contract}} <- Contracts1],
Contracts3 = orddict:from_list(Contracts2),
+ NextLabel = dialyzer_codeserver:get_next_core_label(Codeserver),
{SuccTypes, PltContracts, NotFixpoint} =
- find_succ_types_for_scc(SCC_Info, Contracts3, State),
+ find_succ_types_for_scc(SCC_Info, Contracts3, NextLabel, State),
State1 = insert_into_plt(SuccTypes, State),
ContrPlt = dialyzer_plt:insert_contract_list(State1#st.plt, PltContracts),
{State1#st{plt = ContrPlt}, NotFixpoint}.
-find_succ_types_for_scc(SCC_Info, Contracts,
- #st{codeserver = Codeserver,
- callgraph = Callgraph, plt = Plt} = State) ->
+find_succ_types_for_scc(SCC_Info, Contracts, NextLabel,
+ #st{callgraph = Callgraph, plt = Plt} = State) ->
%% Assume that the PLT contains the current propagated types
AllFuns = collect_fun_info([Fun || {_MFA, {_Var, Fun}, _Rec} <- SCC_Info]),
PropTypes = get_fun_types_from_plt(AllFuns, State),
- MFAs = [MFA || {MFA, {_Var, _Fun}, _Rec} <- SCC_Info],
- NextLabel = dialyzer_codeserver:get_next_core_label(Codeserver),
- Plt1 = dialyzer_plt:delete_contract_list(Plt, MFAs),
FunTypes = dialyzer_typesig:analyze_scc(SCC_Info, NextLabel,
- Callgraph, Plt1, PropTypes),
+ Callgraph, Plt, PropTypes),
AllFunSet = sets:from_list([X || {X, _} <- AllFuns]),
FilteredFunTypes = dict:filter(fun(X, _) ->
sets:is_element(X, AllFunSet)