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

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.
22 jobs for !3863 with hsyl20/dynflags/cmmtoasm in 388 minutes and 22 seconds (queued for 2 seconds)
detached
Status Job ID Name Coverage
  Lint
passed #416225
lint
ghc-linters

00:00:15

passed #416226
lint
lint-linters

00:00:14

passed #416229
lint
lint-submods

00:00:21

passed #416227
lint
lint-testsuite

00:00:16

passed #416228
lint
typecheck-testsuite

00:00:15

 
  Quick Build
passed #416230
x86_64-linux
hadrian-ghc-in-ghci

00:09:02

 
  Build
passed #416231
x86_64-linux
validate-x86_64-linux-deb9-hadrian

01:49:52

 
  Full Build
failed #416234
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

03:04:54

failed #416235
armv7-linux allowed to fail
validate-armv7-linux-deb9

03:52:23

passed #416236
x86_64-linux
validate-i386-linux-deb9

01:31:11

passed #416233
x86_64-darwin
validate-x86_64-darwin

01:10:57

passed #416237
x86_64-linux
validate-x86_64-linux-deb9-debug

02:12:32

passed #416239
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:49:13

passed #416238
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

00:54:18

passed #416232
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

03:21:28

passed #416240
x86_64-linux
validate-x86_64-linux-fedora27

00:57:17

failed #416242
new-x86_64-windows test allowed to fail
validate-x86_64-windows

00:28:59

failed #416241
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian

00:46:55

 
  Cleanup
passed #416243
x86_64-darwin
cleanup-darwin

00:00:20

 
  Packaging
failed #416244
x86_64-linux allowed to fail
doc-tarball

00:00:33

 
  Testing
manual #416245
x86_64-linux allowed to fail manual
hackage
passed #416246
x86_64-linux
perf-nofib

00:35:13

 
Name Stage Failure
failed
doc-tarball Packaging
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Downloading artifacts
Downloading artifacts for validate-x86_64-linux-deb9-debug (416237)...
Downloading artifacts from coordinator... ok
id=416237 responseStatus=200 OK token=GYWrYrQn
Executing "step_script" stage of the job script
$ if [ ! -f "$LINUX_BINDIST" ]; then # collapsed multi-line command
Error: ghc-x86_64-mingw32.tar.xz does not exist. Did the 64-bit Windows job fail?
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=8324 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-x86_64-windows-hadrian Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=7688 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

performance-metrics.tsv: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=416234 responseStatus=201 Created token=YuY4Jkpv
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=416234 responseStatus=201 Created token=YuY4Jkpv
ERROR: Job failed: exit code 1
failed
validate-armv7-linux-deb9 Full Build
Uploading artifacts...
ghc-armv7-linux-deb9.tar.xz: found 1 matching files

junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=416235 responseStatus=201 Created token=V9rHguEK
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=416235 responseStatus=201 Created token=V9rHguEK
ERROR: Job failed: exit code 1