www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21597] New: Compiler flag should output a "normalized" file


          Issue ID: 21597
           Summary: Compiler flag should output a "normalized" file
                    without unittests and comments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andrei erdani.com

One D file is really four files in one:

* The summary/header/".h"/interface file, with declarations and bodies of
template functions and inline functions.

* The documentation file, consisting of all declarations together with their
documentation comments, and also documentation unittests.

* The unittest file, consisting of the unittests.

* The implementation file, containing the actual code.

This conflation makes it difficult for build systems to distinguish changes:
was the change to the interface, documentation, unittests, or implementation?
Of course, all extant build systems assume "all of the above" and proceed with
wasteful compilation of the normal build, the unittest build, the documentation
build, and the rebuild of all dependencies.

This needs addressing. The -H feature already extracts the interface file; it
is currently broken and needs attention. There is no feature to extract the
implementation file sans unittests. We need such.

Jan 30 2021