aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-03-05 13:01:11 +0100
committerHenrik Nord <[email protected]>2012-05-21 15:31:22 +0200
commit76b7c72882ee521a7c5a39d33ecf1009a72ee4e3 (patch)
treeb224305134449b3d373a6b247d7a12c9b8d2ffd1 /lib
parent19f4b4090fd38085d60596b4685c9323501d473e (diff)
downloadotp-76b7c72882ee521a7c5a39d33ecf1009a72ee4e3.tar.gz
otp-76b7c72882ee521a7c5a39d33ecf1009a72ee4e3.tar.bz2
otp-76b7c72882ee521a7c5a39d33ecf1009a72ee4e3.zip
Fix types and specs
Diffstat (limited to 'lib')
-rw-r--r--lib/dialyzer/src/dialyzer_analysis_callgraph.erl20
-rw-r--r--lib/dialyzer/src/dialyzer_callgraph.erl2
-rw-r--r--lib/dialyzer/src/dialyzer_coordinator.erl6
3 files changed, 19 insertions, 9 deletions
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
index e2e65d2e25..67c5b3241d 100644
--- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
@@ -35,9 +35,9 @@
start_compilation/2,
continue_compilation/2]).
--export_type([compile_mid_data/0,
- compile_result/0,
- compile_init_data/0]).
+-export_type([compile_init_data/0,
+ one_file_result/0,
+ compile_result/0]).
-include("dialyzer.hrl").
@@ -265,9 +265,15 @@ compile_and_store(Files, #analysis_state{codeserver = CServer,
{Callgraph, sets:from_list(NoWarn), CServer2}.
-type compile_init_data() :: #compile_init{}.
--type compile_result() :: {list(), list(), list()}. %%opaque
--type one_file_result() :: term(). %%opaque
--type compile_mid_data() :: term(). %%opaque
+-type error_reason() :: string().
+-type compile_result() :: {[{file:filename(), error_reason()}], [mfa()],
+ [module()]}. %%opaque
+-type one_file_result() :: {error, error_reason()} |
+ {ok, [dialyzer_callgraph:callgraph_edge()],
+ [mfa_or_funlbl()], [mfa()], module()}. %%opaque
+-type compile_mid_data() :: {module(), cerl:cerl(), [mfa()],
+ dialyzer_callgraph:callgraph(),
+ dialyzer_codeserver:codeserver()}.
-spec compile_init_result() -> compile_result().
@@ -287,7 +293,7 @@ add_to_result(File, NewData, {Failed, NoWarn, Mods}, InitData) ->
end.
-spec start_compilation(file:filename(), compile_init_data()) ->
- {error, term()} |{ok, integer(), compile_mid_data()}.
+ {error, error_reason()} |{ok, integer(), compile_mid_data()}.
start_compilation(File,
#compile_init{callgraph = Callgraph, codeserver = Codeserver,
diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl
index 3330ec252d..d6307ec658 100644
--- a/lib/dialyzer/src/dialyzer_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_callgraph.erl
@@ -64,7 +64,7 @@
put_named_tables/2, put_public_tables/2, put_behaviour_api_calls/2,
get_behaviour_api_calls/1, dispose_race_server/1, duplicate/1]).
--export_type([callgraph/0, mfa_or_funlbl/0]).
+-export_type([callgraph/0, mfa_or_funlbl/0, callgraph_edge/0]).
-include("dialyzer.hrl").
diff --git a/lib/dialyzer/src/dialyzer_coordinator.erl b/lib/dialyzer/src/dialyzer_coordinator.erl
index 1ae30d9862..8ebbb11137 100644
--- a/lib/dialyzer/src/dialyzer_coordinator.erl
+++ b/lib/dialyzer/src/dialyzer_coordinator.erl
@@ -69,6 +69,10 @@
-type result() :: compile_result() | typesig_result() |
dataflow_result() | warnings_result().
+-type job() :: scc() | module() | file:filename().
+-type job_result() :: dialyzer_analysis_callgraph:one_file_result() |
+ typesig_result() | dataflow_result() | warnings_result().
+
-record(state, {active = 0 :: integer(),
result :: result(),
next_label = 0 :: integer(),
@@ -226,7 +230,7 @@ pid_partition(SCC, {Pids, Unknown}) ->
_:_ -> {Pids, [SCC|Unknown]}
end.
--spec job_done(scc() | module() | file:filename(), term(), coordinator()) -> ok.
+-spec job_done(job(), job_result(), coordinator()) -> ok.
job_done(Job, Result, Coordinator) ->
Coordinator ! {done, Job, Result},