[m-rev.] for review: some_int_const
Julien Fischer
jfischer at opturion.com
Thu Jun 3 16:42:03 AEST 2021
On Thu, 3 Jun 2021, Zoltan Somogyi wrote:
> Replace ten int cons_ids with one.
>
> We currently have one function symbol in the cons_id type for each
> of our ten types of integer constants: signed vs unsigned, and
> word-sized, 8-bit, 16-bit, 32-bit and 64-bit. In most places in the compiler,
> these are all treated the same, and it gets tedious to have to write
> the same logic ten times. This diff therefore changes things so that
> the distinction between int constants of these ten types is pushed
> to one level lower than the cons_id type.
>
> compiler/prog_data.m:
> Replace the ten cons_ids {int,uint}{,8,16,32,64}_const with just one,
> some_int_const, whose argument now has those function symbols.
>
> Add some utility functions on integer constants.
>
> compiler/prog_out.m:
> Add a utility predicate for converting int constants to strings.
>
> compiler/parse_tree_to_term.m:
> Add a utility predicate for converting int constants to terms.
>
> compiler/old_type_constraints.m:
> Conform to the changes above.
>
> Fix an old bug, though this does not matter since this module is unused.
That looks fine; I didn't look at the rest of this diff in much detail
since it just seems to be the obvious changes.
Julien.
More information about the reviews
mailing list