diff options
author | Maria Christakis <[email protected]> | 2010-10-17 18:20:53 +0300 |
---|---|---|
committer | Maria Christakis <[email protected]> | 2010-11-30 10:11:37 +0200 |
commit | f1d81c87d832c805a90a8dceca247cecaad803ab (patch) | |
tree | a60013d9f913af3a4ba445725694ef429d6c9cc5 /lib/dialyzer/src/dialyzer_gui.erl | |
parent | 4101091756a98d78cde0d6b2d88959dae324e860 (diff) | |
download | otp-f1d81c87d832c805a90a8dceca247cecaad803ab.tar.gz otp-f1d81c87d832c805a90a8dceca247cecaad803ab.tar.bz2 otp-f1d81c87d832c805a90a8dceca247cecaad803ab.zip |
dialyzer: Add support for multiple PLTs
This new feature is able to take multiple PLTs, merge them during the
start of the analysis, and work from there. This works provided that
the PLTs do not have a module with the same name appearing in more
than one PLT.
The PLTs are created in the usual way:
dialyzer --build_plt --output_plt PLT_1 FILES_TO_INCLUDE
...
dialyzer --build_plt --output_plt PLT_N FILES_TO_INCLUDE
and then can be used in either of the following ways:
dialyzer FILES_TO_ANALYZE --plts PLT_1 ... PLT_N
or:
dialyzer --plts PLT_1 ... PLT_N -- FILES_TO_ANALYZE
(Note the -- delimiter in the second case)
Diffstat (limited to 'lib/dialyzer/src/dialyzer_gui.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_gui.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/dialyzer/src/dialyzer_gui.erl b/lib/dialyzer/src/dialyzer_gui.erl index f353638cdf..4436330f7f 100644 --- a/lib/dialyzer/src/dialyzer_gui.erl +++ b/lib/dialyzer/src/dialyzer_gui.erl @@ -88,8 +88,8 @@ -spec start(#options{}) -> ?RET_NOTHING_SUSPICIOUS. -start(DialyzerOptions = #options{from = From, init_plt = InitPltFile, - legal_warnings = LegalWarnings}) -> +start(#options{from = From, init_plts = InitPltFiles, + legal_warnings = LegalWarnings} = DialyzerOptions) -> process_flag(trap_exit, true), GS = gs:start(), @@ -336,9 +336,13 @@ start(DialyzerOptions = #options{from = From, init_plt = InitPltFile, gs:config(Packer, WH), {ok, CWD} = file:get_cwd(), - InitPlt = try dialyzer_plt:from_file(InitPltFile) - catch throw:{dialyzer_error, _} -> dialyzer_plt:new() - end, + InitPlt = + case InitPltFiles of + [] -> dialyzer_plt:new(); + _ -> + Plts = [dialyzer_plt:from_file(F) || F <- InitPltFiles], + dialyzer_plt:merge_plts_or_report_conflicts(InitPltFiles, Plts) + end, State = #gui_state{add_all = AddAll, add_file = AddFile, |