Compiler development

Tim Krimm twkrimm at gmail.com
Sun Apr 1 14:26:43 PDT 2012


What is the process for developing the dmd compiler?

Years ago, when I worked on the IBM PLX/PLAS compiler, we had a
large collection of test case files.

We would create two executable versions of the compiler.
One executable was the "good" version and the other version was
the 'GOOD' version with the developers changes.

We would run a script.

       1) first compiler runs the test cases.
       2) second compiler runs the test cases.
       3) each compiler generated its own unique directory 
structure
of results.
       4) the results can be compiler lists, assembly listings, etc
       5) the two directory structures are compared with a compare
utility
       6) the developer looks through the compare program output
       7) if the differences make sense, the changes are added to
the
code base.

pros
        helps reduce breakage of existing code when adding new
features

cons
        can slow down development looking through a bunch of 
compare
listings.

Our script was very complex, it allowed us to change compiler
settings and change what we wanted to compare and what was
generated by the compiler.
Also the compare utility had settings that allowed it to only put
out differences or differences with a couple of lines before and
after to help locate the cause of the differences. or the
developer could just go back and rerun the particular test case
if it needed further analysis.

Note:The dmd compiler is written in C++ not D, so you do not have
the luxury of builtin unit tests.



More information about the Digitalmars-d mailing list