[m-rev.] for review: make convert_options_to_globals more manageable

Julien Fischer jfischer at opturion.com
Mon Oct 12 21:25:29 AEDT 2020


On Mon, 12 Oct 2020, Zoltan Somogyi wrote:

> For review by anyone.
>
> Since this diff affects many kinds of options, I have bootchecked it
> in hlc.gc, asm_fast.gc, and debug and deep prof grades.

...

> Make convert_options_to_globals more manageable,

Full stop instead of a comma there.

> compiler/handle_options.m:
>     Make the code of convert_options_to_globals more manageable,
>     in three ways.
>
>     One way is to take some parts of it that deal with one aspect of
>     compilation, and put them into predicates of their own.
>
>     Another way is to eliminate some repeated tests. (Some still remain.)
>     Instead of several switchs on the target language, each setting

s/switchs/switches/

>     one set of options, have one switch that deals with all those sets
>     of options. Move formerly top-level if-then-else into arms of
>     such switches if one part of the condition selects that switch arm.
>
>     The third way is to move code dealing with related things nearer
>     to each other (in many cases, not all, partly because some things
>     are related to more than two other things).

That looks fine otherwise.

Julien.


More information about the reviews mailing list