[m-rev.] for review: --support-ms-clr

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 12 02:57:46 AEDT 2002


On 11-Mar-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> Add the --support-ms-clr option.  This helps to make clear which parts
> of the IL code generator are there to work around the MS CLR bugs and
> which are there to generate correct IL.
...
> Index: compiler/mlds_to_il.m
> @@ -1580,10 +1585,20 @@
>  			),
>  			{ ByRefTailCalls = no }
>  		),
> -		% We must not output the "tail." prefix unless the
> -		% callee return type is compatible with the caller
> -		% return type
> -		{ ReturnParam = CallerReturnParam }
> +		% if --verifiable-code is enabled, then we must not output
> +		% the "tail." prefix unless the callee return type is
> +		% compatible with the caller return type
> +		\+ (
> +			{ VerifiableCode = yes },
> +			{ ReturnParam \= CallerReturnParam }
> +		),
> +		% Work around a bug in the MS CLR implementation where the
> +		% return type of a tail call must be compatible with the
> +		% caller return type.
> +		\+ (
> +			{ MsCLR = yes },
> +			{ ReturnParam \= CallerReturnParam }
> +		)

The comment here should emphasize that the MS CLR implementation
requires these types to be compatible even for unverifiable code.

> Index: compiler/options.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
> retrieving revision 1.360
> diff -u -r1.360 options.m
> --- compiler/options.m	8 Mar 2002 04:03:26 -0000	1.360
> +++ compiler/options.m	11 Mar 2002 14:09:48 -0000
> @@ -475,6 +475,7 @@
>  			
>  			% IL
>  		;	dotnet_library_version
> +		;	support_ms_clr
>  
>  	% Link options
>  		;	output_file_name
> @@ -948,7 +949,8 @@
>  % IL
>  		% We default to the version of the library that came
>  		% with Beta2.
> -	dotnet_library_version	-	string("1.0.3300.0")
> +	dotnet_library_version	-	string("1.0.3300.0"),
> +	support_ms_clr		-	bool(yes)
>  ]).
>  option_defaults_2(link_option, [
>  		% Link Options
> @@ -1478,6 +1480,7 @@
>  long_option("java-object-file-extension", java_object_file_extension).
>  
>  long_option("dotnet-library-version",	dotnet_library_version).
> +long_option("support-ms-clr",		support_ms_clr).
>  
>  % link options
>  long_option("output-file",		output_file_name).
> @@ -3093,7 +3096,10 @@
>  
>  		"--dotnet-library-version <version-number>",
>  		"\tThe version number for the mscorlib assembly distributed",
> -		"\twith the Microsoft .NET SDK."
> +		"\twith the Microsoft .NET SDK.",
> +
> +		"--no-support-ms-clr",
> +		"\tDon't use MS CLR specific workarounds in the generated code."
>  	]).
>  
>  :- pred options_help_link(io__state::di, io__state::uo) is det.
> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.299
> diff -u -r1.299 user_guide.texi
> --- doc/user_guide.texi	8 Mar 2002 04:03:41 -0000	1.299
> +++ doc/user_guide.texi	11 Mar 2002 14:09:51 -0000
> @@ -5638,6 +5638,11 @@
>  The version number for the mscorlib assembly distributed with the
>  Microsoft .NET SDK.
>  
> + at sp 1
> + at item --no-support-ms-clr
> + at findex --no-support-ms-clr
> +Don't use MS CLR specific workarounds in the generated code.
> +

Neither this option nor the `--dotnet-library-version' option
belong in the "Target code compilation options" section.
That section specifies how the target code will be compiled,
not what target code will be generated.

The `--no-support-ms-clr' option probably best belongs in the
"Target options" subsection of the "Compilation model" options section.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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