Make warnings for TH splices opt-in

In #17270 we have the pattern-match checker emit incorrect warnings. The
reason for that behavior is ultimately an inconsistency in whether we
treat TH splices as written by the user (`FromSource :: Origin`) or as
generated code (`Generated`). This was first reported in #14838.

The current solution is to TH splices as `Generated` by default and only
treat them as `FromSource` when the user requests so
(-fenable-th-splice-warnings). There are multiple reasons for opt-in
rather than opt-out:

  * It's not clear that the user that compiles a splice is the author of the code
    that produces the warning. Think of the situation where she just splices in
    code from a third-party library that produces incomplete pattern matches.
    In this scenario, the user isn't even able to fix that warning.
  * Gathering information for producing the warnings (pattern-match check
    warnings in particular) is costly. There's no point in doing so if the user
    is not interested in those warnings.

Fixes #17270, but not #14838, because the proper solution needs a GHC
proposal extending the TH AST syntax.
22 jobs for master in 477 minutes and 8 seconds (queued for 3 minutes and 42 seconds)
Status Job ID Name Coverage
  Lint
passed #211479
lint
lint-linters

00:01:54

passed #211482
lint
lint-submods-branch

00:01:55

passed #211480
lint
lint-testsuite

00:01:54

passed #211481
lint
typecheck-testsuite

00:00:56

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

00:16:43

 
  Build
passed #211486
x86_64-linux
release-x86_64-linux-deb9-dwarf

01:47:20

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

03:43:08

passed #211484
x86_64-linux
validate-x86_64-linux-deb9-hadrian

02:42:10

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

03:31:48

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

03:23:22

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

00:40:59

passed #211488
x86_64-darwin
validate-x86_64-darwin

01:05:53

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

01:00:14

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

01:43:05

passed #211493
x86_64-linux
validate-x86_64-linux-fedora27

00:43:47

failed #211495
x86_64-windows allowed to fail
validate-x86_64-windows

00:05:55

failed #211494
x86_64-windows allowed to fail
validate-x86_64-windows-hadrian

00:05:43

 
  Cleanup
passed #211496
x86_64-darwin
cleanup-darwin

00:00:07

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

00:00:30

 
  Testing
manual #211498
x86_64-linux allowed to fail manual
hackage
passed #211499
x86_64-linux
perf-nofib

00:18:47

 
  Deploy
failed #211500
x86_64-linux allowed to fail
pages

00:02:11

 
Name Stage Failure
failed
pages Deploy
$ git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true
warning: no common commits
From https://gitlab.haskell.org/ghc/ghc-performance-notes
* [new ref] refs/notes/perf -> refs/notes/perf
$ mkdir -p public/doc
$ tar -xf haddock.html.tar.xz -C public/doc
tar: haddock.html.tar.xz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
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=211490 responseStatus=201 Created token=Mtx4PBqR
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=211490 responseStatus=201 Created token=Mtx4PBqR
ERROR: Job failed: exit code 1
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-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=211489 responseStatus=201 Created token=hrTtRNCF
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=211489 responseStatus=201 Created token=hrTtRNCF
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build
Runtime platform                                    arch=amd64 os=windows pid=4208 revision=1f513601 version=11.10.1
WARNING: ghc.tar.xz: no matching files
WARNING: junit.xml: no matching files
ERROR: No files to upload
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=5324 revision=1f513601 version=11.10.1
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-x86_64-windows Full Build
Runtime platform                                    arch=amd64 os=windows pid=9176 revision=1f513601 version=11.10.1
WARNING: $BIN_DIST_PREP_TAR_COMP: no matching files
WARNING: junit.xml: no matching files
ERROR: No files to upload
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=8360 revision=1f513601 version=11.10.1
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
doc-tarball Packaging
Synchronizing submodule url for 'utils/hsc2hs'
$ git submodule update --init --recursive
$ git checkout .gitmodules
$ git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true
From https://gitlab.haskell.org/ghc/ghc-performance-notes
4a83c74fec..7ac3fdd394 refs/notes/perf -> refs/notes/perf
$ 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