summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/DebugBlock.hs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2020-08-10 17:58:17 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-13 03:44:52 -0400
commit55dec4dc6e8f8430810d212c73e78ffbb92e0a48 (patch)
tree2880ec2360764311c30afdba74ace624ef642cb1 /compiler/GHC/Cmm/DebugBlock.hs
parent7831fe05021caa90d4696ca91ae2b31a82e65b3d (diff)
downloadhaskell-55dec4dc6e8f8430810d212c73e78ffbb92e0a48.tar.gz
PmCheck: Better long-distance info for where bindings (#18533)
Where bindings can see evidence from the pattern match of the `GRHSs` they belong to, but not from anything in any of the guards (which belong to one of possibly many RHSs). Before this patch, we did *not* consider said evidence, causing #18533, where the lack of considering type information from a case pattern match leads to failure to resolve the vanilla COMPLETE set of a data type. Making available that information required a medium amount of refactoring so that `checkMatches` can return a `[(Deltas, NonEmpty Deltas)]`; one `(Deltas, NonEmpty Deltas)` for each `GRHSs` of the match group. The first component of the pair is the covered set of the pattern, the second component is one covered set per RHS. Fixes #18533. Regression test case: T18533
Diffstat (limited to 'compiler/GHC/Cmm/DebugBlock.hs')
-rw-r--r--compiler/GHC/Cmm/DebugBlock.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Cmm/DebugBlock.hs b/compiler/GHC/Cmm/DebugBlock.hs
index 4e39fb7ecd..2d8ec5f2b3 100644
--- a/compiler/GHC/Cmm/DebugBlock.hs
+++ b/compiler/GHC/Cmm/DebugBlock.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiWayIf #-}
@@ -110,7 +111,9 @@ cmmDebugGen modLoc decls = map (blocksForScope Nothing) topScopes
-- recover by copying ticks below.
scp' | SubScope _ scp' <- scp = scp'
| CombinedScope scp' _ <- scp = scp'
+#if __GLASGOW_HASKELL__ <= 810
| otherwise = panic "findP impossible"
+#endif
scopeMap = foldr (uncurry insertMulti) Map.empty childScopes