[m-rev.] for review: fix foreign_decls in the LLDS grades

Simon Taylor stayl at cs.mu.OZ.AU
Wed Aug 7 23:42:59 AEST 2002


On 07-Aug-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> On Wed, Aug 07, 2002 at 09:17:34PM +1000, Simon Taylor wrote:
> > On 07-Aug-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > > Estimated hours taken: 0.5
> > > Branches: main
> > > 
> > > When intermodule optimization is enabled make the .o file depend on all
> > > the possible imported .mh files.  This avoids unneccessary recompilation
> > > because the .mh files are less likely to change, as well as a directory
> > > search for .m files.

> diff -u compiler/modules.m compiler/modules.m
> --- compiler/modules.m	7 Aug 2002 10:59:15 -0000
> +++ compiler/modules.m	7 Aug 2002 13:01:13 -0000
> @@ -3760,17 +3760,7 @@
>  	io__write_string(DepStream, MakeVarName),
>  	io__write_string(DepStream, ".mhs = "),
>  	( { Target = c ; Target = asm } ->
> -		% We only generate `.mh' files for modules containing
> -		% `:- pragma export' declarations.
> -		{ HeaderModules =
> -		    list__filter(
> -			(pred(Module::in) is semidet :-
> -			    map__lookup(DepsMap, Module,
> -			    		deps(_, ModuleImports)),
> -			    contains_foreign_export =
> -					ModuleImports ^ contains_foreign_export 
> -			), Modules) },
> -		write_dependencies_list(HeaderModules, ".mh", DepStream)
> +		write_dependencies_list(Modules, ".mh", DepStream)
>  	;
>  		[]
>  	),

You should use write_compact_dependencies_list here.

> --- compiler/make.module_target.m	17 Jul 2002 07:09:21 -0000	1.11
> +++ compiler/make.module_target.m	7 Aug 2002 13:08:05 -0000
> @@ -556,20 +556,10 @@
>  	    ),
>  
>  	    { ( CompilationTarget = c ; CompilationTarget = asm ) ->
> -		    %
> -		    % We only generate a `.mh' file if the module contains
> -		    % `:- pragma export' declarations.
> -		    %
> -	    	PragmaExportModuleNames =
> -			list__filter_map(
> -			    (func(MImports) =
> -			    		MImports ^ module_name is semidet :-
> -				contains_foreign_export =
> -				    MImports ^ contains_foreign_export
> -			    ), ModuleImportsList),
> -	    	HeaderTargets =
> -			make_target_list(PragmaExportModuleNames, c_header(mh))
> -			++ HeaderTargets0
> +		Names = list__map((func(MI) = MI ^ module_name),
> +				ModuleImportsList),
> +	    	HeaderTargets = make_target_list(Names, c_header(mh))
> +				++ HeaderTargets0
>  	    ;
>  		HeaderTargets = HeaderTargets0
>  	    },

Use `SourceFileModuleNames' rather than computing `Names'.

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list