dmd
dmd copied to clipboard
Move usage fields from Param to DMDparam
These are driver-specific, rather than language tuning.
Thanks for your pull request, @ibuclaw!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#13795"
LDC uses three of these - transition, preview, revert - as it supports -preview=? etc. too and displays the same help.
LDC uses three of these - transition, preview, revert - as it supports
-preview=?etc. too and displays the same help.
Aren't you using your own option parser though? Assumedly you have your own internal options state rather than patching over globals.d in the front-end.
Nope, I reuse the parser for these options, so that I don't have to adapt it whenever option values are added/removed.
I thought that dmdparams refers only to backend specific parameters. The ones that are moved in this PR seem to be frontend related.
I thought that dmdparams refers only to backend specific parameters. The ones that are moved in this PR seem to be frontend related.
They are not required for semantic. They are only for the command line parser (driver) component, to which gdc handles this externally in C++ land (using gcc infrastructure to generate the C++ code to handle it, rather than doing it ourselves, naturally).
I thought that dmdparams refers only to backend specific parameters. The ones that are moved in this PR seem to be frontend related.
There is a mix of Params and DMDParams used in backend. See backend_init().
@kinke do you suggest we leave transition, preview, revert in Param?
Well, I agree with Iain that the usage bools shouldn't be part of Params. Moving to DMDParams might be a bit of a hassle for LDC, but oh well.
https://github.com/ldc-developers/ldc/blob/490bdcb0dd1c23f9552f116a3e9b68198fd36355/dmd/mars.d#L242
https://github.com/ldc-developers/ldc/blob/490bdcb0dd1c23f9552f116a3e9b68198fd36355/dmd/mars.d#L1630-L1724 (forgot that the parseCLIOption parser is duplicated by LDC, as the DMD one is a nested helper function in DMD's parseCommandLine…)