Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
2003-dialyzer_callgraph-Optimize-module_postord...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2003-dialyzer_callgraph-Optimize-module_postorder-1-and-m.patch of Package erlang
From 644184ca7c0c80e6c766aa4c3728aa992c498efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Mon, 13 Sep 2021 16:16:17 +0200 Subject: [PATCH 03/20] dialyzer_callgraph: Optimize module_postorder/1 and module_deps/1 --- lib/dialyzer/src/dialyzer_callgraph.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl index f858a81e63..fcf2c9d8af 100644 --- a/lib/dialyzer/src/dialyzer_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_callgraph.erl @@ -281,10 +281,10 @@ modules(#callgraph{digraph = DG}) -> -spec module_postorder(callgraph()) -> {[module()], {'d', digraph:graph()}}. module_postorder(#callgraph{digraph = DG}) -> - Edges = lists:foldl(fun edge_fold/2, sets:new(), digraph_edges(DG)), - Nodes = sets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]), + Edges = lists:foldl(fun edge_fold/2, sets:new([{version, 2}]), digraph_edges(DG)), + Modules = ordsets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]), MDG = digraph:new([acyclic]), - digraph_confirm_vertices(sets:to_list(Nodes), MDG), + digraph_confirm_vertices(Modules, MDG), Foreach = fun({M1,M2}) -> _ = digraph:add_edge(MDG, M1, M2) end, lists:foreach(Foreach, sets:to_list(Edges)), %% The out-neighbors of a vertex are the vertices called directly. @@ -303,14 +303,14 @@ edge_fold(_, Set) -> Set. -spec module_deps(callgraph()) -> mod_deps(). module_deps(#callgraph{digraph = DG}) -> - Edges = lists:foldl(fun edge_fold/2, sets:new(), digraph_edges(DG)), - Nodes = sets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]), + Edges = lists:foldl(fun edge_fold/2, sets:new([{version, 2}]), digraph_edges(DG)), + Modules = ordsets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]), MDG = digraph:new(), - digraph_confirm_vertices(sets:to_list(Nodes), MDG), + digraph_confirm_vertices(Modules, MDG), Foreach = fun({M1,M2}) -> check_add_edge(MDG, M1, M2) end, lists:foreach(Foreach, sets:to_list(Edges)), Deps = [{N, ordsets:from_list(digraph:in_neighbours(MDG, N))} - || N <- sets:to_list(Nodes)], + || N <- Modules], digraph_delete(MDG), dict:from_list(Deps). -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor