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

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 26 03:26:10 AEST 2001


On 25-May-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> 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]

A comment might be nice, but otherwise this looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  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