Why is mangling different for separate compilation?

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 29 08:27:54 PST 2016


On Mon, 29 Feb 2016 08:22:45 +0100, Jacob Carlborg wrote:

> On 2016-02-28 22:03, Chris Wright wrote:
> 
>> Or like there's a global counter that is incremented for each unittest.
>> A different order of traversal of unittests would result in a different
>> mangled name for the same unittest in different runs.
> 
> The question is why it would be different.
> 
> Here's a guess:
> 
> * The compiler will perform semantic analysis of the code in the current
> module before processing any imports

Simpler than that. Module foo.a imports std.stdio; module foo.b imports 
foo.a and std.path. When compiling separately, you're not necessarily 
changing the ordering property of the modules you run semantic on, but 
you are changing the set of modules.


More information about the Digitalmars-d mailing list