[m-rev.] for review: making pointer_equal a builtin

Peter Wang novalazy at gmail.com
Thu Nov 27 18:00:30 AEDT 2014


On Mon, 24 Nov 2014 23:25:16 +1100 (EST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Make pointer_equal a builtin.
> 
> There was an inline pragma on its definition, but most programs, including
> the compiler, are not compiled with the intermodule optimization options
> that would allow this to take effect. Making it a builtin gets around this
> problem.

Minor point: most programs are compiled without intermodule optimization
_during development_.

> +std_binop_to_elds(StdBinOp, EldsBinOp) :-
> +    require_complete_switch [StdBinOp]
> +    (
> +        ( StdBinOp = body
> +        ; StdBinOp = array_index(_)
> +        ; StdBinOp = unsigned_le
> +        ; StdBinOp = float_from_dword       % XXX used to fail IMPLICITLY
> +        ; StdBinOp = float_word_bits        % XXX used to fail IMPLICITLY
> +        ; StdBinOp = str_cmp                % XXX used to fail IMPLICITLY
> +        ; StdBinOp = pointer_equal_conservative % handled in our caller
> +        ),
> +        fail

That's fine.  None of those ops would be used in the Erlang backend as
far as I can tell.  erl_gen_simple_expr would throw an exception if they
were used.

The rest looks okay as well.  Please try installing the java, csharp,
erlang grades if you haven't already done so.

Peter



More information about the reviews mailing list