diff options
author | doyougnu <jeffrey.young@iohk.io> | 2022-02-23 11:08:22 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-02 14:11:43 -0500 |
commit | 91a10cb06aa9ace905adeff3cc795de9c40f64a9 (patch) | |
tree | 3eb2f47f21226678faa8fd602d2b51ac5984f253 /compiler/GHC/Stg/Lint.hs | |
parent | c8652a0afc3d8b56d39f39ff587271dcc46b17ba (diff) | |
download | haskell-91a10cb06aa9ace905adeff3cc795de9c40f64a9.tar.gz |
GenStgAlt 3-tuple synonym --> Record type
This commit alters GenStgAlt from a type synonym to a Record with field
accessors. In pursuit of #21078, this is not a required change but cleans
up several areas for nicer code in the upcoming js-backend, and in GHC
itself.
GenStgAlt: 3-tuple -> record
Stg.Utils: GenStgAlt 3-tuple -> record
Stg.Stats: StgAlt 3-tuple --> record
Stg.InferTags.Rewrite: StgAlt 3-tuple -> record
Stg.FVs: GenStgAlt 3-tuple -> record
Stg.CSE: GenStgAlt 3-tuple -> record
Stg.InferTags: GenStgAlt 3-tuple --> record
Stg.Debug: GenStgAlt 3-tuple --> record
Stg.Lift.Analysis: GenStgAlt 3-tuple --> record
Stg.Lift: GenStgAlt 3-tuple --> record
ByteCode.Instr: GenStgAlt 3-tuple --> record
Stg.Syntax: add GenStgAlt helper functions
Stg.Unarise: GenStgAlt 3-tuple --> record
Stg.BcPrep: GenStgAlt 3-tuple --> record
CoreToStg: GenStgAlt 3-tuple --> record
StgToCmm.Expr: GenStgAlt 3-tuple --> record
StgToCmm.Bind: GenStgAlt 3-tuple --> record
StgToByteCode: GenStgAlt 3-tuple --> record
Stg.Lint: GenStgAlt 3-tuple --> record
Stg.Syntax: strictify GenStgAlt
GenStgAlt: add haddock, some cleanup
fixup: remove calls to pure, single ViewPattern
StgToByteCode: use case over viewpatterns
Diffstat (limited to 'compiler/GHC/Stg/Lint.hs')
-rw-r--r-- | compiler/GHC/Stg/Lint.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs index 405abdd1f4..0ec0650693 100644 --- a/compiler/GHC/Stg/Lint.hs +++ b/compiler/GHC/Stg/Lint.hs @@ -245,15 +245,20 @@ lintStgExpr (StgCase scrut bndr alts_type alts) = do lintAlt :: (OutputablePass a, BinderP a ~ Id) - => (AltCon, [Id], GenStgExpr a) -> LintM () + => GenStgAlt a -> LintM () -lintAlt (DEFAULT, _, rhs) = - lintStgExpr rhs +lintAlt GenStgAlt{ alt_con = DEFAULT + , alt_bndrs = _ + , alt_rhs = rhs} = lintStgExpr rhs -lintAlt (LitAlt _, _, rhs) = - lintStgExpr rhs +lintAlt GenStgAlt{ alt_con = LitAlt _ + , alt_bndrs = _ + , alt_rhs = rhs} = lintStgExpr rhs -lintAlt (DataAlt _, bndrs, rhs) = do +lintAlt GenStgAlt{ alt_con = DataAlt _ + , alt_bndrs = bndrs + , alt_rhs = rhs} = + do mapM_ checkPostUnariseBndr bndrs addInScopeVars bndrs (lintStgExpr rhs) |