StgLint: Enforce MultiValAlt liveness invariant only after unariser
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 29 Aug 2017 18:53:12 +0000 (14:53 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Aug 2017 23:08:07 +0000 (19:08 -0400)
commita36b34c4821653e3db3ff24b903265a7750a3397
tree7521d179d2730cbd17ea9bf577517af6c1238924
parent651b4dc790d931789eb41dd0e8f281de4061824b
StgLint: Enforce MultiValAlt liveness invariant only after unariser

The unariser ensures that we never use case binders that are void,
unboxed sums, or unboxed tuples. However, previously StgLint was
enforcing this invariant even before the unariser was running, giving
rise to spurious lint failures.  Fix this. Following CoreLint, we
introduce a LintFlags environment to the linter monad, allowing for
additional flags to be easily accomodated in the future.

See #14118.

Test Plan: Build GHC with -dstg-lint

Reviewers: simonpj, austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #14118

Differential Revision: https://phabricator.haskell.org/D3889
compiler/simplStg/SimplStg.hs
compiler/stgSyn/StgLint.hs