Why doesn't DMD create any redundant symbols?

Derek Parnell derek at psych.ward
Sat Feb 16 06:00:45 PST 2008


On Tue, 28 Aug 2007 10:36:03 -0700, Walter Bright wrote:

> Gregor Richards wrote:
>> I have to assume there's a reason for this, so, to summarize: Why 
>> doesn't DMD create any redundant symbols in .o files?
> 
> It can improve build speed a lot. With C++, which doesn't do this, huge 
> .obj files can be generated.
> 
> The compiler assumes that if there are multiple modules on the command 
> line, they'll all be linked together, so why generate redundant output?

However, this assumption is not a valid one. They are valid reasons to
compile a set of files (all named on the one command line) that are not
necessarily going to be linked together.

Also, tools such as make, rebuild and bud can determine which subset of a
set of files has been changed and thus only recompiling the subset. I have
found that doing this sometimes causes conflicting object file definitions
between the subset object files and previously compiled object files from
others in the full set.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list