[Issue 13951] New: Massive amounts of bloat generated for asserts by template.c

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jan 7 20:09:00 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13951

          Issue ID: 13951
           Summary: Massive amounts of bloat generated for asserts by
                    template.c
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

The dmd source code in template.c:
-------------------------------------------------------
void TemplateDeclaration::semantic(Scope *sc)
{
    [...]
    if (Module *m = sc->module) // should use getModule() instead?
    {
        // Generate these functions as they may be used
        // when template is instantiated in other modules
        // even if assertions or bounds checking are disabled in this module
        m->toModuleArray();
        m->toModuleAssert();     <=============
        m->toModuleUnittest();
    }
---------------------------------------------------

This results in huge numbers of assert() functions to be generated, each with
its own copy of the source file name string. The assert() function is generated
as a COMDAT, which removes duplicates, but the filename strings are not put in
COMDATs and are duplicated innumerable times.

--


More information about the Digitalmars-d-bugs mailing list