[Issue 3274] dmd fails to emit code for templates into object file if several files are compiled at once

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 7 09:04:11 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=3274


Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu


--- Comment #3 from Martin Nowak <code at dawg.eu> 2013-04-07 09:04:10 PDT ---
(In reply to comment #1)
> The compiler does this as a compile performance optimization. Otherwise,
> template instantiations have to be done over and over, filling the object
> files, and then the linker has to remove the duplicates.
> 
It remains an incorrect optimization that just works most of the time.

> The workaround for an incremental build system is straightforward - put only
> one source module on a command to dmd at a time.

The performance impact of this is also huge. The only reason to do this in the
first place is to avoid duplicate parsing and semantic. However we can't make
any assumptions how the generated object files are linked therefor each of them
needs to get the required TypeInfo, templates et.al.

To put this into perspective, copying is only required when building multiple
object files. It is not required when building an executable, a shared library
or a single object (which may contain multiple modules, i.e. -c -of).

Maybe we can move the copying more to the backend so that we don't have to
rerun IRgen and codegen.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list