[m-dev.] for review: higher-order write_graph

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 28 03:40:14 AEDT 2001


On 27-Feb-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> 
> Move changes from reuse branch onto the main branch.
> These changes were introduced on the reuse branch so that we could
> produce dot files which showed which predicates were calling reuse
> versions, and hence easily determine where reuse was being lost.
> 
> compiler/dependency_graph.m:
>     Add two new predicates write_graph and write_graph_nodes, which take
>     higher order arguments which determine what to write for a node and
>     edge in the graph.
>     Change write_dependency_graph and write_prof_dependency_graph to use
>     the new higher order predicates.

Those bits are fine.

>     Change build_dependency_graph so that it optionally also includes
>     arcs to imported procedures.

That bit is problematic because it breaks the meaning of
ensure_dependency_info.  Previously there was only one kind of
dependency graph, and it was either valid or not, so
ensure_dependency_info just needs to (re)make it if it is not valid.
With your change, there are two kinds; probably the interface to
ensure_dependency_info should change to indicate which kind of
dependency info the caller wants, and if the currently stored one is
not the right kind, ensure_dependency_info should recalculate it.

> Index: compiler/dependency_graph.m
> +++ compiler/dependency_graph.m	2001/02/27 16:11:14
>  
> +	% Build the dependency graph, if the bool is yes then
> +	% imported_procedures aren't included in the dependency graph,
> +	% otherwise they are.
> +:- pred dependency_graph__build_dependency_graph(module_info, bool,
> +		dependency_info).
> +:- mode dependency_graph__build_dependency_graph(in, in, out) is det.

It's confusing for the boolean to be yes if the imported procedures
*aren't* included.  I think it would be clearer to invert the sense
of that argument.

s/, if/. If/

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list