aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-10-08 16:54:44 +0200
committerHans Bolinder <[email protected]>2014-10-08 16:54:44 +0200
commit72e3e9892cb8cbc1aa6ea32095be2b0aebb0f25b (patch)
tree08b4ebf737de0276f1df34b7c54170da276aa765 /lib/dialyzer/src
parent4b49314bb58de1bd1a0b35a218def99ed500f49a (diff)
downloadotp-72e3e9892cb8cbc1aa6ea32095be2b0aebb0f25b.tar.gz
otp-72e3e9892cb8cbc1aa6ea32095be2b0aebb0f25b.tar.bz2
otp-72e3e9892cb8cbc1aa6ea32095be2b0aebb0f25b.zip
dialyzer: do a minor re-factoring
A minor re-factoring and generalization.
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_utils.erl27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl
index 5b744a4bd3..5297a3a7b4 100644
--- a/lib/dialyzer/src/dialyzer_utils.erl
+++ b/lib/dialyzer/src/dialyzer_utils.erl
@@ -444,23 +444,18 @@ cleanup_parse_transforms([]) ->
-spec cleanup_compile_options([compile:option()]) -> [compile:option()].
+cleanup_compile_options(Opts) ->
+ lists:filter(fun keep_compile_option/1, Opts).
+
%% Using abstract, not asm or core.
-cleanup_compile_options([from_asm|Opts]) ->
- Opts;
-cleanup_compile_options([asm|Opts]) ->
- Opts;
-cleanup_compile_options([from_core|Opts]) ->
- Opts;
-cleanup_compile_options([warnings_as_errors|Opts]) ->
- Opts;
-%% The parse transform will already have been applied, may cause problems if it
-%% is re-applied.
-cleanup_compile_options([{parse_transform, _}|Opts]) ->
- Opts;
-cleanup_compile_options([Other|Opts]) ->
- [Other|cleanup_compile_options(Opts)];
-cleanup_compile_options([]) ->
- [].
+keep_compile_option(from_asm) -> false;
+keep_compile_option(asm) -> false;
+keep_compile_option(from_core) -> false;
+%% The parse transform will already have been applied, may cause
+%% problems if it is re-applied.
+keep_compile_option({parse_transform, _}) -> false;
+keep_compile_option(warnings_as_errors) -> false;
+keep_compile_option(_) -> true.
-spec format_errors([{module(), string()}]) -> [string()].