From 4e11f884a5d138ce01fc67add1372ad0cadd2a22 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Fri, 23 Dec 2011 16:45:16 +0200 Subject: Refactorings in dialyzer_analysis_callgraph --- lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index 458f3a4c81..15e642e307 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -177,26 +177,26 @@ analysis_start(Parent, Analysis) -> analyze_callgraph(Callgraph, State) -> Codeserver = State#analysis_state.codeserver, - Plt = dialyzer_plt:insert_callbacks(State#analysis_state.plt, Codeserver), Parent = State#analysis_state.parent, - case State#analysis_state.analysis_type of - plt_build -> - Callgraph1 = dialyzer_callgraph:finalize(Callgraph), - NewPlt = dialyzer_succ_typings:analyze_callgraph(Callgraph1, Plt, - Codeserver, Parent), - dialyzer_callgraph:delete(Callgraph1), - State#analysis_state{plt = NewPlt}; - succ_typings -> - NoWarn = State#analysis_state.no_warn_unused, - DocPlt = State#analysis_state.doc_plt, - Callgraph1 = dialyzer_callgraph:finalize(Callgraph), - {Warnings, NewPlt, NewDocPlt} = - dialyzer_succ_typings:get_warnings(Callgraph1, Plt, DocPlt, - Codeserver, NoWarn, Parent), - dialyzer_callgraph:delete(Callgraph1), - send_warnings(State#analysis_state.parent, Warnings), - State#analysis_state{plt = NewPlt, doc_plt = NewDocPlt} - end. + DocPlt = State#analysis_state.doc_plt, + Plt = dialyzer_plt:insert_callbacks(State#analysis_state.plt, Codeserver), + Callgraph1 = dialyzer_callgraph:finalize(Callgraph), + {NewPlt, NewDocPlt} = + case State#analysis_state.analysis_type of + plt_build -> + {dialyzer_succ_typings:analyze_callgraph(Callgraph1, Plt, + Codeserver, Parent), + DocPlt}; + succ_typings -> + NoWarn = State#analysis_state.no_warn_unused, + {Warnings, NewPlt0, NewDocPlt0} = + dialyzer_succ_typings:get_warnings(Callgraph1, Plt, DocPlt, + Codeserver, NoWarn, Parent), + send_warnings(State#analysis_state.parent, Warnings), + {NewPlt0, NewDocPlt0} + end, + dialyzer_callgraph:delete(Callgraph1), + State#analysis_state{plt = NewPlt, doc_plt = NewDocPlt}. %%-------------------------------------------------------------------- %% Build the callgraph and fill the codeserver. -- cgit v1.2.3