Put platform constants into Platform
To support several platforms at once (represented by Platform
datatype in ghc-boot), we mustn't read platform constants from DynFlags
but from Platform
. It is needed for #14335.
This patch:
- add a
platformConstants
field intoPlatform
in ghc-boot. - avoid using constant wrappers generated by
utils/derivConstants
which relied onDynFlags
- pass Platform or Profile (Profile = Platform + Ways) instead of DynFlags in many places
By doing this, for many more functions the caller can chose the platform to use without having to tweak random fields in DynFlags (#17957)