dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Move usage fields from Param to DMDparam

Open ibuclaw opened this issue 2 years ago • 9 comments

These are driver-specific, rather than language tuning.

ibuclaw avatar Mar 10 '22 17:03 ibuclaw

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"

dlang-bot avatar Mar 10 '22 17:03 dlang-bot

LDC uses three of these - transition, preview, revert - as it supports -preview=? etc. too and displays the same help.

kinke avatar Mar 10 '22 23:03 kinke

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.

ibuclaw avatar Mar 11 '22 09:03 ibuclaw

Nope, I reuse the parser for these options, so that I don't have to adapt it whenever option values are added/removed.

kinke avatar Mar 11 '22 12:03 kinke

I thought that dmdparams refers only to backend specific parameters. The ones that are moved in this PR seem to be frontend related.

RazvanN7 avatar Mar 14 '22 08:03 RazvanN7

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).

ibuclaw avatar Mar 14 '22 09:03 ibuclaw

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().

ljmf00 avatar Mar 14 '22 17:03 ljmf00

@kinke do you suggest we leave transition, preview, revert in Param?

RazvanN7 avatar May 03 '22 09:05 RazvanN7

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…)

kinke avatar May 03 '22 09:05 kinke