[m-rev.] trivial diff: mercury_compile.m: fix c2init call

Simon Taylor stayl at cs.mu.OZ.AU
Wed Nov 28 01:10:53 AEDT 2001


Sorry, wrong log message.


Estimated hours taken: 0.1

compiler/mercury_compile.m:
	Pass the grade to c2init. This fixes a bug -- the initialization
	code generated is grade-dependent.

	Use the `--init-c-file' c2init option rather than `-o'.

> Index: mercury_compile.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
> retrieving revision 1.226
> diff -u -u -r1.226 mercury_compile.m
> --- mercury_compile.m	26 Nov 2001 10:57:31 -0000	1.226
> +++ mercury_compile.m	27 Nov 2001 13:52:59 -0000
> @@ -3841,6 +3841,8 @@
>  	    ;
>  		TraceOpt = ""
>  	    },
> +	    globals__io_get_globals(Globals),
> +	    { compute_grade(Globals, Grade) },
>  
>  	    globals__io_lookup_accumulating_option(init_file_directories,
>  			InitFileDirsList),
> @@ -3854,8 +3856,9 @@
>  
>  	    join_module_list(Modules, ".c", [], CFileNames),
>  	    { MkInitCmd = string__append_list(
> -	    	["c2init ", TraceOpt, " -o ", InitCFileName, " ",
> -		InitFileDirs, " ", InitFileNames, " " | CFileNames]) },
> +	    	["c2init --grade ", Grade, " ", TraceOpt,
> +		" --init-c-file ", InitCFileName, " ", InitFileDirs, " ",
> +		InitFileNames, " " | CFileNames]) },
>  	    invoke_shell_command(MkInitCmd, MkInitOK),
>  	    maybe_report_stats(Stats),
>  	    ( { MkInitOK = no } ->
> @@ -3871,8 +3874,6 @@
>  		    report_error("compilation of init file failed.")
>  		;
>  		    maybe_write_string(Verbose, "% Linking...\n"),
> -		    globals__io_get_globals(Globals),
> -		    { compute_grade(Globals, Grade) },
>  		    globals__io_lookup_bool_option(target_debug, Target_Debug),
>  		    { Target_Debug = yes ->
>  		    	Target_Debug_Opt = "--no-strip "

--------------------------------------------------------------------------
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