aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2011-12-19 16:04:27 +0100
committerHans Bolinder <[email protected]>2011-12-22 13:01:52 +0100
commit477fd95a1f404175c133f30a9e10e7a27ce400b8 (patch)
treec3a28c6b72333c9e25f44537f038ceac7a76ea4f /lib/dialyzer/src/dialyzer_analysis_callgraph.erl
parent01f35546b9dbaac053a80418b38105a1acc35540 (diff)
downloadotp-477fd95a1f404175c133f30a9e10e7a27ce400b8.tar.gz
otp-477fd95a1f404175c133f30a9e10e7a27ce400b8.tar.bz2
otp-477fd95a1f404175c133f30a9e10e7a27ce400b8.zip
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.erl13
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),