diff options
author | Hans Bolinder <[email protected]> | 2012-01-09 15:46:08 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2012-01-09 15:46:08 +0100 |
commit | d8ca0eb6de482a9a4bb5d67bc33232352c3ec83e (patch) | |
tree | cfae6c83131e939abb3e012b99b7fd6124a4bcc0 /lib/dialyzer/src/dialyzer_analysis_callgraph.erl | |
parent | f9ca630a95e1e2adb1b225bfb69e3101678183f3 (diff) | |
parent | 477fd95a1f404175c133f30a9e10e7a27ce400b8 (diff) | |
download | otp-d8ca0eb6de482a9a4bb5d67bc33232352c3ec83e.tar.gz otp-d8ca0eb6de482a9a4bb5d67bc33232352c3ec83e.tar.bz2 otp-d8ca0eb6de482a9a4bb5d67bc33232352c3ec83e.zip |
Merge branch 'hb/dialyzer/nowarn_unused_function/OTP-9833' into maint
* hb/dialyzer/nowarn_unused_function/OTP-9833:
Handle nowarn_unused_function like the compiler does
Diffstat (limited to 'lib/dialyzer/src/dialyzer_analysis_callgraph.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index b42f5e8191..458f3a4c81 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -359,8 +359,17 @@ store_core(Mod, Core, NoWarn, Callgraph, CServer) -> store_code_and_build_callgraph(Mod, LabeledCore, Callgraph, CServer3, NoWarn). abs_get_nowarn(Abs, M) -> - [{M, F, A} - || {attribute, _, compile, {nowarn_unused_function, {F, A}}} <- Abs]. + Opts = lists:flatten([C || {attribute, _, compile, C} <- Abs]), + Warn = erl_lint:bool_option(warn_unused_function, nowarn_unused_function, + true, Opts), + case Warn of + false -> + [{M, F, A} || {function, _, F, A, _} <- Abs]; % all functions + true -> + [{M, F, A} || + {nowarn_unused_function, FAs} <- Opts, + {F, A} <- lists:flatten([FAs])] + end. get_exported_types_from_core(Core) -> Attrs = cerl:module_attrs(Core), |