From d144dd6b9913051c900876064478a0f2dd232b35 Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Sat, 9 Jan 2021 18:53:06 +0100 Subject: WIP: Enable linear Lint after desugaring --- compiler/GHC/Core/Lint.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler/GHC/Core') 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 -- cgit v1.2.1