Incremental compilation with DMD
Walter Bright
newshound1 at digitalmars.com
Thu Sep 17 03:33:06 PDT 2009
Tom S wrote:
> Personally I'm of the opinion that functions should
> be explicitly marked for CTFE, and this is just another reason for such.
> I'm using a patched DMD with added pragma(ctfe) which instructs the
> compiler not to run any codegen or generate debug info
> functions/aggregates marked as such. This trick alone can slim an
> executable down by a good megabyte, which sometimes is a life-saver with
> OPTLINK.
If you are compiling files with -lib, and nobody calls those CTFE
functions at runtime, then they should never be linked in. (Virtual
functions are always linked in, as they have a reference to them even if
they are never called.)
Executables built this way shouldn't have dead functions in them.
More information about the Digitalmars-d
mailing list