diff options
author | Björn-Egil Dahlberg <[email protected]> | 2010-12-02 12:24:18 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2010-12-02 12:24:26 +0100 |
commit | 4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3 (patch) | |
tree | 7bef76c162b15eb26447236f1fc323fe3b0a39dc /lib/dialyzer/src/dialyzer_options.erl | |
parent | 13338198802371d70ca40686d2998861b45edcc4 (diff) | |
parent | f1d81c87d832c805a90a8dceca247cecaad803ab (diff) | |
download | otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.tar.gz otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.tar.bz2 otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.zip |
Merge branch 'ks/dialyzer/support-multiple-plts' into dev
* ks/dialyzer/support-multiple-plts:
dialyzer: Add support for multiple PLTs
OTP-8962
Diffstat (limited to 'lib/dialyzer/src/dialyzer_options.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_options.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl index 010625b7bd..2c0afa6e2b 100644 --- a/lib/dialyzer/src/dialyzer_options.erl +++ b/lib/dialyzer/src/dialyzer_options.erl @@ -53,14 +53,21 @@ build(Opts) -> InitPlt = dialyzer_plt:get_default_plt(), DefaultOpts = #options{}, DefaultOpts1 = DefaultOpts#options{legal_warnings = DefaultWarns1, - init_plt = InitPlt}, - try - NewOpts = build_options(Opts, DefaultOpts1), + init_plts = [InitPlt]}, + try + Opts1 = preprocess_opts(Opts), + NewOpts = build_options(Opts1, DefaultOpts1), postprocess_opts(NewOpts) catch throw:{dialyzer_options_error, Msg} -> {error, Msg} end. +preprocess_opts([]) -> []; +preprocess_opts([{init_plt, File}|Opts]) -> + [{plts, [File]}|preprocess_opts(Opts)]; +preprocess_opts([Opt|Opts]) -> + [Opt|preprocess_opts(Opts)]. + postprocess_opts(Opts = #options{}) -> Opts1 = check_output_plt(Opts), adapt_get_warnings(Opts1). @@ -144,9 +151,9 @@ build_options([{OptionName, Value} = Term|Rest], Options) -> build_options(Rest, Options#options{from = Value}); get_warnings -> build_options(Rest, Options#options{get_warnings = Value}); - init_plt -> - assert_filenames([Term], [Value]), - build_options(Rest, Options#options{init_plt = Value}); + plts -> + assert_filenames(Term, Value), + build_options(Rest, Options#options{init_plts = Value}); include_dirs -> assert_filenames(Term, Value), OldVal = Options#options.include_dirs, |