[m-rev.] for review: fix detism warnings for compound compare builtins

Peter Wang wangp at students.csse.unimelb.edu.au
Tue Jul 17 16:04:25 AEST 2007


On 2007-07-17, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> For review by anyone.
> 
> Zoltan.
> 
> Fix a problem I noticed while fixing bootstrap at -O6: determinism warnings for
> private_builtin.m.
> 
> compiler/add_pred.m:
> 	Mark builtin predicates (e.g. the recently added compound_{lt,eq})
> 	for which we generate never-to-be-invoked dummy bodies as just stubs,
> 	to avoid determinism warnings from the compiler.

Thanks, I was just doing this part.


> Index: c_util.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/c_util.m,v
> retrieving revision 1.35
> diff -u -b -r1.35 c_util.m
> --- c_util.m	18 Mar 2007 23:34:51 -0000	1.35
> +++ c_util.m	15 Jul 2007 12:42:05 -0000
> @@ -96,29 +96,8 @@
>  %
>  % Operators.
>  %
> -% The following predicates all take as input an operator, check if it is
> -% an operator of the specified kind, and if so, return the name of the
> -% corresponding C operator that can be used to implement it.
> -
> -    % The operator returned will be <, >, etc.;
> -    % it can be used in the form `strcmp(<Arg1>, <Arg2>) <Op> 0'.
> -    %
> -:- pred string_compare_op(binary_op::in, string::out) is semidet.
> -
> -    % The operator returned will be +, *, etc.;
> -    % the arguments should be floats and the result will be a float.
> -    %
> -:- pred float_op(binary_op::in, string::out) is semidet.
> -
> -    % The operator returned will be <, >, etc.;
> -    % the arguments should be floats and the result will be a boolean.
> -    %
> -:- pred float_compare_op(binary_op::in, string::out) is semidet.
> -
> -    % The operator returned will be an infix operator. The arguments should be
> -    % cast to MR_Unsigned, and the result will be a boolean.
> -    %
> -:- pred unsigned_compare_op(binary_op::in, string::out) is semidet.
> +% The following predicates all take as input an operator, and return the name
> +% of the corresponding C operator that can be used to implements it.

to implement it.

> Index: llds_out.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
> retrieving revision 1.311
> diff -u -b -r1.311 llds_out.m
> --- llds_out.m	14 Jul 2007 02:32:43 -0000	1.311
> +++ llds_out.m	16 Jul 2007 03:01:01 -0000

> @@ -3107,12 +3103,13 @@
>          !IO),
>      output_rval_decls_format(Rval2, FirstIndent, LaterIndent, !N, !DeclSet,
>          !IO),
> -        %
> +
>          % If floats are boxed, and the static ground terms option is enabled,
>          % then for each float constant which we might want to box we declare
>          % a static const variable holding that constant.
> -        %
> -    ( c_util.float_op(Op, OpStr) ->
> +
> +    c_util.binop_category_string(Op, Category, OpStr),
> +    ( Category =  float_arith_binop ->

Doubled space there.


It looks fine.

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