From f1d81c87d832c805a90a8dceca247cecaad803ab Mon Sep 17 00:00:00 2001 From: Maria Christakis Date: Sun, 17 Oct 2010 18:20:53 +0300 Subject: 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) --- lib/dialyzer/src/dialyzer_gui_wx.erl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/dialyzer/src/dialyzer_gui_wx.erl') diff --git a/lib/dialyzer/src/dialyzer_gui_wx.erl b/lib/dialyzer/src/dialyzer_gui_wx.erl index 2e309d7ec1..e711c15ea7 100644 --- a/lib/dialyzer/src/dialyzer_gui_wx.erl +++ b/lib/dialyzer/src/dialyzer_gui_wx.erl @@ -88,7 +88,7 @@ start(DialyzerOptions) -> State = wx:batch(fun() -> create_window(Wx, DialyzerOptions) end), gui_loop(State). -create_window(Wx, DialyzerOptions) -> +create_window(Wx, #options{init_plts = InitPltFiles} = DialyzerOptions) -> {ok, Host} = inet:gethostname(), %%---------- initializing frame --------- @@ -258,11 +258,15 @@ create_window(Wx, DialyzerOptions) -> plt = PltMenu, options =OptionsMenu, help = HelpMenu}, - - InitPlt = try dialyzer_plt:from_file(DialyzerOptions#options.init_plt) - 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, + #gui_state{add = AddButton, add_dir = AddDirButton, add_rec = AddRecButton, -- cgit v1.2.3