Skip to content

Put platform constants into Platform

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/platform/constants into master

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 into Platform in ghc-boot.
  • avoid using constant wrappers generated by utils/derivConstants which relied on DynFlags
  • 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)

Edited by Sylvain Henry

Merge request reports