[m-rev.] for review: record use of reserved addresses

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Oct 1 23:00:22 AEST 2007


On Mon, 1 Oct 2007, Peter Wang wrote:

> On 2007-09-25, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
>> compiler/type_util.m:
>> 	Factor out some common code, and replace some map.searches (that could
>> 	fail only if previous code screwed up) with map.lookup.
>
> This change causes the following problem to appear when building
> builtin.m in non-C grades.

Are you sure it's just the non-C grades?  I can't see why it wouldn't
also affect the C grades.

> make_hlds_passes.m:183 succeeds on compiler_generated_rtti_for_builtins,
> so we call add_builtin_type_ctor_special_preds for the type_ctors in
> builtin_type_ctors_with_no_hlds_type_defn, e.g. builtin.int/0.

It is also odd that builtin_type_ctors_with_no_hlds_type_defn is defined
in prog_type.m since nothing in the parse_tree package actually uses it.

> classify_type_ctor gets called, which knows about unqualified("int")/0,
> but not builtin.int/0.  It tries to look that up in the type definition
> table, but aborts because it doesn't exist.
>
> How should I fix this?

I was going to say that classify_type_ctor (and classify_type) shouldn't be
called until after module qualification, so all the builtin type should be
module qualified with `builtin' by the time they are called.

Having just had a quick glance through the compiler it appears we
are not terribly consistent about this, type_util.m:770 certainly
looks a little suspicious

Julien.
--------------------------------------------------------------------------
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