From a9c8a2496d54668d2d46133ff0ef1787cd7b80d6 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 10 Feb 2010 11:03:35 +0200 Subject: dialyzer: New version for the R13B04 release --- lib/dialyzer/src/dialyzer_callgraph.erl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'lib/dialyzer/src/dialyzer_callgraph.erl') diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl index 21d31df71c..1f79e16449 100644 --- a/lib/dialyzer/src/dialyzer_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_callgraph.erl @@ -27,7 +27,8 @@ %%%------------------------------------------------------------------- -module(dialyzer_callgraph). --export([all_nodes/1, +-export([add_edges/2, + all_nodes/1, delete/1, finalize/1, is_escaping/2, @@ -55,7 +56,8 @@ -export([cleanup/1, get_digraph/1, get_named_tables/1, get_public_tables/1, get_race_code/1, get_race_detection/1, race_code_new/1, put_race_code/2, put_race_detection/2, put_named_tables/2, - put_public_tables/2]). + put_public_tables/2, put_behaviour_api_calls/2, + get_behaviour_api_calls/1]). -include("dialyzer.hrl"). @@ -97,7 +99,8 @@ race_code = dict:new() :: dict(), public_tables = [] :: [label()], named_tables = [] :: [string()], - race_detection = false :: boolean()}). + race_detection = false :: boolean(), + beh_api_calls = [] :: [{mfa(), mfa()}]}). %% Exported Types @@ -695,3 +698,15 @@ to_ps(#callgraph{} = CG, File, Args) -> Command = io_lib:format("dot -Tps ~s -o ~s ~s", [Args, File, Dot_File]), _ = os:cmd(Command), ok. + +%------------------------------------------------------------------------------- + +-spec put_behaviour_api_calls([{mfa(), mfa()}], callgraph()) -> callgraph(). + +put_behaviour_api_calls(Calls, Callgraph) -> + Callgraph#callgraph{beh_api_calls = Calls}. + +-spec get_behaviour_api_calls(callgraph()) -> [{mfa(), mfa()}]. + +get_behaviour_api_calls(Callgraph) -> + Callgraph#callgraph.beh_api_calls. -- cgit v1.2.3 From abe48c24c115fd629063653eef7bdabd0f82fbbc Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Tue, 16 Feb 2010 16:33:11 +0200 Subject: dialyzer: Fix system_limit exception in race analysis dialyzer_callgraph: Avoid creation of too many ets tables by the race analysis. dialyzer_dataflow: The digraph returned by the race analysis should not be the translated one. --- lib/dialyzer/src/dialyzer_callgraph.erl | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'lib/dialyzer/src/dialyzer_callgraph.erl') diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl index 1f79e16449..696d504978 100644 --- a/lib/dialyzer/src/dialyzer_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_callgraph.erl @@ -55,8 +55,8 @@ -export([cleanup/1, get_digraph/1, get_named_tables/1, get_public_tables/1, get_race_code/1, get_race_detection/1, race_code_new/1, - put_race_code/2, put_race_detection/2, put_named_tables/2, - put_public_tables/2, put_behaviour_api_calls/2, + put_digraph/2, put_race_code/2, put_race_detection/2, + put_named_tables/2, put_public_tables/2, put_behaviour_api_calls/2, get_behaviour_api_calls/1]). -include("dialyzer.hrl"). @@ -611,15 +611,17 @@ digraph_reaching_subgraph(Funs, DG) -> -spec cleanup(callgraph()) -> callgraph(). -cleanup(#callgraph{name_map = NameMap, - rev_name_map = RevNameMap, - public_tables = PublicTables, - named_tables = NamedTables, - race_code = RaceCode}) -> - #callgraph{name_map = NameMap, - rev_name_map = RevNameMap, - public_tables = PublicTables, - named_tables = NamedTables, +cleanup(#callgraph{digraph = Digraph, + name_map = NameMap, + rev_name_map = RevNameMap, + public_tables = PublicTables, + named_tables = NamedTables, + race_code = RaceCode}) -> + #callgraph{digraph = Digraph, + name_map = NameMap, + rev_name_map = RevNameMap, + public_tables = PublicTables, + named_tables = NamedTables, race_code = RaceCode}. -spec get_digraph(callgraph()) -> digraph(). @@ -652,6 +654,11 @@ get_race_detection(#callgraph{race_detection = RD}) -> race_code_new(Callgraph) -> Callgraph#callgraph{race_code = dict:new()}. +-spec put_digraph(digraph(), callgraph()) -> callgraph(). + +put_digraph(Digraph, Callgraph) -> + Callgraph#callgraph{digraph = Digraph}. + -spec put_race_code(dict(), callgraph()) -> callgraph(). put_race_code(RaceCode, Callgraph) -> -- cgit v1.2.3