summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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