[m-rev.] for post-commit review: stop using need_qualifier where it does not belong

Peter Wang novalazy at gmail.com
Mon Nov 11 16:57:54 AEDT 2019

On Sat, 09 Nov 2019 17:53:14 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For post-commit review by anyone. I would love is someone
> could tell me what the intended purpose and/or semantics
> of the replaced type is in this context.

I'm not really familiar with smart recompilation so this is a guess.

recomp_must_be_qualified is passed for modules imported via

check_for_simple_item_ambiguity_2 and a few similar predicates are,
AFAICS, the only places RecompNeedQual is consulted.

    check_for_simple_item_ambiguity_2(ItemType, RecompNeedQual, SymName, Arity,
	    OldModuleQualifier, OldMatchingModuleName, !Info) :-
	Name = unqualify_name(SymName),
	( if
	    % XXX This is a bit conservative in the case of partially qualified
	    % names but that hopefully won't come up too often.
	    RecompNeedQual = recomp_must_be_qualified,
	    OldModuleQualifier = unqualified("")
	else if

I think the logic is something like this: if the module begins to
`use_module m1' then that can NOT in of itself cause a previously
unqualified name `f' to become ambiguous: `f' would never be qualified
as `m1.f', therefore that is not a reason to force recompilation.

On the other hand, if the module begins to `import_module m2' then `f'
MIGHT be qualified to `m2.f' in addition to whatever it was qualified to
previously, therefore recompilation should not be skipped.


More information about the reviews mailing list