summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-01-09 18:53:06 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-01-09 18:53:21 +0100
commitd144dd6b9913051c900876064478a0f2dd232b35 (patch)
tree44b47e6e60136914eaba0f62eb6b0720c37ac0e6
parent47c7b54f07c44fe661d51930f6ff84b37ff7b125 (diff)
downloadhaskell-wip/linear-empty-case.tar.gz
WIP: Enable linear Lint after desugaringwip/linear-empty-case
-rw-r--r--compiler/GHC/Core/Lint.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs
index 6dc84b91ab..a20bc8e79a 100644
--- a/compiler/GHC/Core/Lint.hs
+++ b/compiler/GHC/Core/Lint.hs
@@ -481,7 +481,8 @@ lintCoreBindings dflags pass local_in_scope binds
flags = (defaultLintFlags dflags)
{ lf_check_global_ids = check_globals
, lf_check_inline_loop_breakers = check_lbs
- , lf_check_static_ptrs = check_static_ptrs }
+ , lf_check_static_ptrs = check_static_ptrs
+ , lf_check_linearity = check_linearity }
-- See Note [Checking for global Ids]
check_globals = case pass of
@@ -503,6 +504,11 @@ lintCoreBindings dflags pass local_in_scope binds
CorePrep -> AllowAtTopLevel
_ -> AllowAnywhere
+ check_linearity = gopt Opt_DoLinearCoreLinting dflags || (
+ case pass of
+ CoreDesugar -> True
+ _ -> False)
+
(_, dups) = removeDups compare binders
-- dups_ext checks for names with different uniques