Summary: dmd flag for partial compilation (similar to just
                    running preprocessor in C/C++)
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Jonathan M Davis <> 2010-10-13 15:49:16 
PDT ---
Many C and C++ compilers have the option to just run the preprocessor and let
you see the output. That way you can see macro expansions and the like. It
would be extremely useful to be able to do something similar in D.

Given that D has mixins (both and string and template) as well as quite a few
constructs for conditional compilation, it would be useful to be able to see
what the code generated by all that looks like before it gets fully compiled by
dmd. So, for instance, you could see that mixin("a = b + 5;"); became

a = b + 5;

Obviously, in such a simple case it wouldn't be all that helpful, but it's easy
to get very complicated string mixins and debugging them can be quite
difficult. Being able to see the mixed in code could really help. Seeing
instantiated templates as well as the actually compiled in code for static ifs
and version blocks could be useful as well. Also, showing the lowerings for
stuff like operator overloads and scope statements could be useful, though I
don't think that it's quite as obviously useful.

Regardless, being able to see the generated code (and potentially lowered code)
could be extremely useful, and I think that it would be a great addition to dmd
to include a flag that did that.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to