Skip to content

Handle the special ghc-prim:GHC.Prim module in the compiler

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/merge-ghc-prim-bignum into master

Before this patch, some custom hacks were necessary in ghc-prim's Setup.hs to register the GHC.Prim (virtual) module and in Hadrian to generate haddocks properly.

In this patch we special-case this module in the compiler itself instead (which it already is, see ghcPrimIface in GHC.Iface.Load). From Cabal/Hadrian's perspective GHC.Prim is now just a normal autogenerated module.

This simplification is worthwhile on its own. It was found while looking into the work needed for #24453 (closed) which aims to merge ghc-prim, ghc-bignum, and ghc-internal. It's also one step closer to remove ghc-prim's custom setup.

Merge request reports

Loading