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

Peter Ross pro at missioncriticalit.com
Thu Oct 31 20:49:45 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 0.25
Branches: main

Avoid a fixed limitation in the MSVC C compiler where switches can
only have a maximum size of 512 branches.

compiler/handle_options.m:
	When using MSVC as the C compiler set max_jump_table_size to
	be 512.

README.MS-VisualC:
	Remove documentation about setting the max_jump_table_size
	option as it is now done automatically.


Index: README.MS-VisualC
===================================================================
RCS file: /home/mercury1/repository/mercury/README.MS-VisualC,v
retrieving revision 1.4
diff -u -r1.4 README.MS-VisualC
--- README.MS-VisualC	28 Oct 2002 13:44:50 -0000	1.4
+++ README.MS-VisualC	31 Oct 2002 09:41:03 -0000
@@ -82,12 +82,3 @@
 fails.
 
 -----------------------------------------------------------------------------
-
-NONE.* GRADES
-
-The following flag needs to be passed to the compiler, when compiling
-in the none.* grades to avoid a limitation in the C compiler.
-
---max-jump-table-size 512
-
------------------------------------------------------------------------------
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.155
diff -u -r1.155 handle_options.m
--- compiler/handle_options.m	22 Oct 2002 04:35:53 -0000	1.155
+++ 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))
+	;
+		[]
+	),
+
 	% Conservative GC implies --no-reclaim-heap-*
 	( { gc_is_conservative(GC_Method) = yes } ->
 		globals__io_set_option(

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