[m-dev.] for review: conditionally include Aditi support

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Apr 19 19:34:21 AEST 1999


On 14-Apr-1999, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Preprocess mercury_compile.m and rl_file.m to remove dependencies
> on rl_code.m. This is done to avoid major mode analysis efficiency
> problems on the alias branch.
...
> compiler/mercury_compile.pp:
> compiler/rl_file.pp:
> 	Add preprocessing to remove dependencies on 

That sentence is incomplete.

>  clean:
> +	for file in *.pp; do \
> +		if [ "$$file" != "*.pp" ]; then \
> +			rm -f `basename $$file .pp`.m; \
> +		fi \
> +	done

There's a missing semicolon there:

	s/fi/fi;/

> --- mercury_compile.m	Wed Apr 14 16:28:55 1999
> +++ mercury_compile.pp	Wed Mar 31 17:23:46 1999
>  		% magic sets can report errors.
>  		{ module_info_num_errors(HLDS50, NumErrors) },
>  		( { NumErrors = 0 } ->
> -		    { module_info_get_do_aditi_compilation(HLDS50, Aditi) },
> -		    ( { Aditi = do_aditi_compilation } ->
> -			mercury_compile__generate_rl_bytecode(HLDS50,
> -				Verbose, MaybeRLFile)
> -		    ;
> -			{ MaybeRLFile = no }
> -		    ),
> +		    mercury_compile__generate_rl_bytecode(HLDS50,
> +			Verbose, MaybeRLFile),
>  		    ( { AditiOnly = yes } ->
>  		    	[]
>  		    ; { HighLevelC = yes } ->
> @@ -1035,13 +1034,24 @@
>  :- mode mercury_compile__generate_rl_bytecode(in, in, out, di, uo) is det.
>  
>  mercury_compile__generate_rl_bytecode(ModuleInfo, Verbose, MaybeRLFile) -->
> -	maybe_write_string(Verbose, "% Generating RL...\n"),
> -	maybe_flush_output(Verbose),
> -	rl_gen__module(ModuleInfo, RLProcs0),
> -	mercury_compile__maybe_dump_rl(RLProcs0, ModuleInfo, "", ""),
> -	rl_opt__procs(ModuleInfo, RLProcs0, RLProcs),
> -	mercury_compile__maybe_dump_rl(RLProcs, ModuleInfo, "", ".opt"),
> -	rl_out__generate_rl_bytecode(ModuleInfo, RLProcs, MaybeRLFile).
> +	{ module_info_get_do_aditi_compilation(ModuleInfo, Aditi) },
> +	( { Aditi = do_aditi_compilation } ->
> +		maybe_write_string(Verbose, "% Generating RL...\n"),
> +		maybe_flush_output(Verbose),
> +		rl_gen__module(ModuleInfo, RLProcs0),
> +		mercury_compile__maybe_dump_rl(RLProcs0, ModuleInfo, "", ""),
> +		rl_opt__procs(ModuleInfo, RLProcs0, RLProcs),
> +		mercury_compile__maybe_dump_rl(RLProcs,
> +			ModuleInfo, "", ".opt"),
> +#if INCLUDE_ADITI_OUTPUT	% See ../Mmake.common.in.
> +		rl_out__generate_rl_bytecode(ModuleInfo, RLProcs, MaybeRLFile)
> +#else
> +		{ error(
> +	"mercury_compile.pp: `--aditi' requires `INCLUDE_ADITI_OUTPUT'") }
> +#endif
> +	;
> +		{ MaybeRLFile = no }
> +	).

I don't understand exactly why you moved the test inside the predicate
mercury_compile__generate_rl_bytecode, but if you do so, then you
should probably rename it as mercury_compile__maybe_generate_rl_bytecode.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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