[Dlang-internal] Separate compilation identifier mess and the bug trail that ensued
kinke
noone at nowhere.com
Thu Jul 26 19:18:47 UTC 2018
On Thursday, 26 July 2018 at 18:43:24 UTC, kinke wrote:
> On Thursday, 26 July 2018 at 09:09:07 UTC, Atila Neves wrote:
>> If I do it during semantic analysis it would be easy: keep a
>> counter per module.
>
> Ah, I thought you wanted to go further (identical names,
> independent of defined versions for compiler invokation etc.).
> I looked at a PR of yours, where you changed back from
> finalizing the identifier in semantic, assuming that it already
> was like that originally, but I now see that you moved it to
> semantic shortly before. ;)
>
> So if it has to be done before semantic and we have no clue
> about the D module at that time, can't we use a counter per Loc
> (filename, line, column)? Only creating one if there's a
> unittest/invariant/... declaration to be uniquely named of
> course, to keep the number of counters reasonably small.
E.g., via a static `int[Loc]` map in `generateIdWithLoc()`, and
replacing the current counter per <base identifier, line, column>
by a counter per <filename, line, column>, thereby isolating each
module via unique path (const char* pointer comparison is most
likely enough => bitwise Loc comparison). [The identifier could
optionally be used as further key component.]
More information about the Dlang-internal
mailing list