[m-rev.] for review: break up simplify.m

Julien Fischer jfischer at opturion.com
Thu Jul 24 12:03:00 AEST 2014

On Thu, 24 Jul 2014, Zoltan Somogyi wrote:

> On Thu, 24 Jul 2014 10:47:00 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>> In relation to the format_call module I suggest separating out the
>> predicate is_format_call/3 and putting it in one of the common utility
>> modules, hlds_code_util for example.  It should then be possible to make
>> format_call a private submodule of the simplify package, since
>> determinism analysis only makes uses of is_format_call/3.
> That is not good idea. The reason is that is_format_call relies on the same database
> of the properties of format-like calls as the transformation that optimises such calls.
> Putting the only copy of this database into e.g. hlds_code_util would introduce unwanted
> coupling between hlds_code_util and format_call,

The trade off here is that by making format_call a private submodule
will simplify the dependency structure of the compiler.  As things stand
now changes to the format_call module will cause a recompile of the
det_analysis module even though the great majority of the code in
format_call module has nothing to do with determisim analysis.

> while duplicating it would be an obvious double maintanence problem.

I certainly wasn't suggesting that!

> I think putting format_call into the interface part of simplify.m is the best available
> compromise. Determinism analysis already has the transformation predicate of
> format_call visible to it; this move won't make anything worse in that regard.

That's also fine by me.


More information about the reviews mailing list