diff options
author | Stavros Aronis <[email protected]> | 2011-12-23 16:45:16 +0200 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2012-02-22 13:04:27 +0100 |
commit | 4e11f884a5d138ce01fc67add1372ad0cadd2a22 (patch) | |
tree | d1adc8b411a5d1e5fd3922003db9379d700f19fb /lib/dialyzer | |
parent | 2f8daabdbdd3d03a4db8e1680a8b2773f0561d5e (diff) | |
download | otp-4e11f884a5d138ce01fc67add1372ad0cadd2a22.tar.gz otp-4e11f884a5d138ce01fc67add1372ad0cadd2a22.tar.bz2 otp-4e11f884a5d138ce01fc67add1372ad0cadd2a22.zip |
Refactorings in dialyzer_analysis_callgraph
Diffstat (limited to 'lib/dialyzer')
-rw-r--r-- | lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 38 |
1 files changed, 19 insertions, 19 deletions
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. |