[m-rev.] diff: tabling in non-C grades

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Dec 20 16:10:59 AEDT 2004


On Mon, 20 Dec 2004, Zoltan Somogyi wrote:

> compiler/table_gen.m:
> 	When processing predicates with tabling pragmas in grades that don't
> 	support tabling, generate a message and ignore the pragma.
>
...
>  %-----------------------------------------------------------------------------%
> +
> +:- pred table_gen__transform_proc_if_possible(eval_method::in,
> +	pred_id::in, proc_id::in, proc_info::in, proc_info::out,
> +	pred_info::in, pred_info::out, module_info::in, module_info::out,
> +	generator_map::in, generator_map::out, io::di, io::uo) is det.
> +
> +table_gen__transform_proc_if_possible(EvalMethod, PredId, ProcId,
> +		!ProcInfo, !PredInfo, !ModuleInfo, !GenMap, !IO) :-
> +	globals__io_get_target(Target, !IO),
> +	( Target = c ->
> +		table_gen__transform_proc(EvalMethod, PredId, ProcId,
> +			!ProcInfo, !PredInfo, !ModuleInfo, !GenMap, !IO)
> +	;

Is this going to do the correct thing for the .agc grades?  In particular
hlc.agc?  At the moment the nightly library installs are breaking on
any machine that attempts to install hlc.agc because accurate garbage
collection is (not yet) compatible with tabling.  I think you also
need the following change:

Index: table_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.68
diff -u -r1.68 table_gen.m
--- table_gen.m	20 Dec 2004 01:20:59 -0000	1.68
+++ table_gen.m	20 Dec 2004 05:02:20 -0000
@@ -345,7 +345,8 @@
 table_gen__transform_proc_if_possible(EvalMethod, PredId, ProcId,
 		!ProcInfo, !PredInfo, !ModuleInfo, !GenMap, !IO) :-
 	globals__io_get_target(Target, !IO),
-	( Target = c ->
+	globals__io_get_gc_method(GC_Method, !IO),
+	( Target = c, GC_Method \= accurate ->
 		table_gen__transform_proc(EvalMethod, PredId, ProcId,
 			!ProcInfo, !PredInfo, !ModuleInfo, !GenMap, !IO)
 	;

Cheers,
Julien.
--------------------------------------------------------------------------
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