Skip to content

DynFlags: refactor GHC.CmmToAsm (#17957, #10143)

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/dynflags/cmmtoasm into master

Another patch extracted from !3367 (closed)

This patch removes the use of `sdocWithDynFlags` from GHC.CmmToAsm.*.Ppr

To do that I've had to make some refactoring:

* X86' and PPC's `Instr` are no longer `Outputable` as they require a
  `Platform` argument

* `Instruction` class now exposes `pprInstr :: Platform -> instr -> SDoc`

* as a consequence, I've refactored some modules to avoid .hs-boot files

* added (derived) functor instances for some datatypes parametric in the
  instruction type. It's useful for pretty-printing as we just have to
  map `pprInstr` before pretty-printing the container datatype.

Merge request reports