[m-rev.] diff: set max_jump_table_size automatically when using MSVC

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 31 21:26:33 AEDT 2002


On 31-Oct-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> 
> +++ compiler/handle_options.m	31 Oct 2002 09:41:04 -0000
> @@ -266,6 +266,15 @@
>  	globals__io_init(OptionTable1, Target, GC_Method, TagsMethod,
>  		TermNorm, TraceLevel, TraceSuppress),
>  
> +	% Using the MSVC compiler implies that we must use a maximum jump
> +	% table size of 512 to avoid a fixed limit in the compiler.
> +	globals__io_lookup_string_option(cc, CC),
> +	( { string__sub_string_search(string__to_lower(CC), "cl", _) } ->
> +		globals__io_set_option(max_jump_table_size, int(512))
> +	;
> +		[]
> +	),
> +

This code duplicates some of the code in compile_target_code.m which
figures out which C compiler is being used.  In fact, the logic here is
different, and wrong.  Testing for "cl" is too likely to get false hits
if you don't check for "gcc" and "lcc" first.

It would be much better to abstract the relevant code in
compile_target_code.m into a subroutine, and call it here.

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