aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-03-13 17:27:50 +0100
committerStavros Aronis <[email protected]>2012-03-14 23:33:29 +0100
commit3cc9dc31c5935168051286d524618b2b64795498 (patch)
tree1e9e98ede5098929ee7bbbc5bb47d0bcb687e2ff /lib/dialyzer/src
parentc6a8074bf0e81a97cdd924943f1ad53ea2a05520 (diff)
downloadotp-3cc9dc31c5935168051286d524618b2b64795498.tar.gz
otp-3cc9dc31c5935168051286d524618b2b64795498.tar.bz2
otp-3cc9dc31c5935168051286d524618b2b64795498.zip
Ensure that -on_load functions are not reported as unused
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_analysis_callgraph.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
index 9b279b012d..5be870d78f 100644
--- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
@@ -365,9 +365,11 @@ abs_get_nowarn(Abs, M) ->
false ->
[{M, F, A} || {function, _, F, A, _} <- Abs]; % all functions
true ->
- [{M, F, A} ||
- {nowarn_unused_function, FAs} <- Opts,
- {F, A} <- lists:flatten([FAs])]
+ OnLoad =
+ lists:flatten([{M, F, A} || {attribute, _, on_load, {F, A}} <- Abs]),
+ OnLoad ++ [{M, F, A} ||
+ {nowarn_unused_function, FAs} <- Opts,
+ {F, A} <- lists:flatten([FAs])]
end.
get_exported_types_from_core(Core) ->