[m-rev.] for review: don't abort on :- pragma memo on non-C backends

Peter Wang wangp at students.csse.unimelb.edu.au
Mon Jul 30 17:04:07 AEST 2007


On 2007-07-30, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> 
>  On Fri, 27 Jul 2007, Peter Wang wrote:
> 
> > Estimated hours taken: 1
> > Branches: main
> >
> > compiler/add_pragma.m:
> > 	Don't add declarations or clauses for tabling statistics and tabling
> > 	reset predicates unless the backend supports C as a foreign language.
> > 	This prevents warnings about those predicates missing clauses on other
> > 	backends during type checking.
> >
> > 	Rename table_info_global_var_name to table_info_c_global_var_name.
> 
>  Rather than not adding the declarations it might be better to add
>  a clause that is equivalent to true for the reset predicate and that
>  calls error/1 (or whatever --allow-stubs does) for the statistics.
>  (Alternatively, you could just add a clause for the statistics predicate
>  that causes it to print out at a message that tabling statistics are
>  unavailable.)

If we do it at the item stage then we get a warning from determinism
analysis because the predicates are det but the call to sorry is
erroneous, so we have to special case that somehow.  Otherwise I guess
we can handle the tabling predicates specially in typecheck.m, where the
stubs are generated for user-defined predicates.  Both seem too messy.

>  I think the above behaviour is more in keeping with the fact that
>  memo and loopcheck pragmas are ignored in grades that don't support
>  tabling.
> 
>  (What is the current behaviour of the C backend when --high-level-data
>  is enabled?)

I don't know.

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list