[m-rev.] for review: make analysis framework not require I/O state

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Feb 21 14:11:15 AEDT 2008


On Thu, 21 Feb 2008, Peter Wang wrote:

> Estimated hours taken: 6
> Branches: main
>
> Make the intermodule analysis framework not require the I/O state for looking
> up and recording analysis results.  The I/O state was required because
> analysis files were loaded "on demand" but in most cases this was pointless.
> Now we just load all the analysis files of imported modules before we run
> anything that uses the analysis framework.

s/imported modules/transitively imported modules/

> compiler/analysis.file.m:
> compiler/analysis.m:
> 	Make the main change above.
>
> 	Use `unexpected' instead of `error' for fatal errors.
>
> 	Replace `{Call, Answer, analysis_status}' tuples by a new type
> 	`analysis_result'.
>
> 	Rename the existing existentially-typed `analysis_result' to
> 	`some_analysis_result'.
>
> 	Remove the `module_is_local' method from the `compiler' typeclass.
> 	Replace it by a plain procedure that takes an `analysis_info' as
> 	input, instead of using the I/O state.
>
> 	Use trace goals for debugging output, where we no longer have the I/O
> 	state.
>
> 	Clean up some code.
>
> compiler/mercury_compile.m:
> 	Before running anything that uses the analysis framework, read in all
> 	the analysis files which might be needed.
>
> compiler/mmc_analysis.m:
> 	Delete `module_is_local' method.
>
> compiler/constraint.m:
> compiler/deforest.m:
> compiler/exception_analysis.m:
> compiler/goal_form.m:
> compiler/goal_util.m:
> compiler/pd_util.m:
> compiler/simplify.m:
> compiler/size_prof.m:
> compiler/tabling_analysis.m:
> compiler/trailing_analysis.m:
> compiler/unused_args.m:
> 	Conform to the changes above.
>
> 	Don't thread I/O state through procedures which no longer require it.

...

> +%-----------------------------------------------------------------------------%
> Index: compiler/analysis.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/analysis.m,v
> retrieving revision 1.1
> diff -u -r1.1 analysis.m
> --- compiler/analysis.m	20 Feb 2008 03:09:59 -0000	1.1
> +++ compiler/analysis.m	20 Feb 2008 23:48:11 -0000
> @@ -48,15 +48,7 @@
>     % module_id_to_write_file_name(Compiler, ModuleId, Ext, FileName)
>     %
>     pred module_id_to_write_file_name(Compiler::in, module_id::in,
> -        string::in, string::out, io::di, io::uo) is det,
> -
> -    % module_is_local(Compiler, ModuleId, IsLocal, !IO)
> -    %
> -    % IsLocal is `yes' if the module is not a "library" module, i.e. we are
> -    % able to reanalyse the module, not just use results that already exist.
> -    %
> -    pred module_is_local(Compiler::in, module_id::in, bool::out,
> -        io::di, io::uo) is det
> +        string::in, string::out, io::di, io::uo) is det
> ].
>
> :- type module_id == string.
> @@ -124,6 +116,13 @@
>
> :- typeclass extra_info(ExtraInfo) <= to_string(ExtraInfo) where [].

Although it's not relevant to this change, the extra_info thing is now
redundant since the change to make .opt files work with intermodule
analysis.

That looks fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list