[m-rev.] for review: wrap_blocks and calls

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 25 17:57:01 AEST 2001


compiler/wrap_blocks.m:
	Do not include call instructions in blocks. They cannot refer to the
	local variables of the block, and moving them outside the blocks
	avoids the failure of the tests/debugger/all_solutions test case
	when library/std_util.m is compiled with --use-local-vars.

Zoltan.

cvs diff: Diffing .
Index: wrap_blocks.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/wrap_blocks.m,v
retrieving revision 1.1
diff -u -b -r1.1 wrap_blocks.m
--- wrap_blocks.m	2001/04/24 06:10:17	1.1
+++ wrap_blocks.m	2001/05/24 23:43:09
@@ -57,15 +57,15 @@
 	Instr0 = Uinstr0 - _Comment0,
 	opt_util__count_temps_instr(Uinstr0, R0, R1, F0, F1),
 	( ( R1 > 0 ; F1 > 0) ->
-		( opt_util__can_instr_fall_through(Uinstr0, no) ->
-			list__reverse([Instr0 | RevSofar], BlockInstrs),
-			wrap_instrs(Instrs0, 0, 0, [], Instrs1),
-			Instrs = [block(R1, F1, BlockInstrs) - "" | Instrs1]
-		; Uinstr0 = label(_) ->
+		( ( Uinstr0 = label(_) ; Uinstr0 = call(_, _, _, _, _, _) ) ->
 			list__reverse(RevSofar, BlockInstrs),
 			wrap_instrs(Instrs0, 0, 0, [], Instrs1),
 			Instrs = [block(R1, F1, BlockInstrs) - "", Instr0
 				| Instrs1]
+		; opt_util__can_instr_fall_through(Uinstr0, no) ->
+			list__reverse([Instr0 | RevSofar], BlockInstrs),
+			wrap_instrs(Instrs0, 0, 0, [], Instrs1),
+			Instrs = [block(R1, F1, BlockInstrs) - "" | Instrs1]
 		;
 			wrap_instrs(Instrs0, R1, F1,
 				[Instr0 | RevSofar], Instrs)
cvs diff: Diffing notes
--------------------------------------------------------------------------
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