summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Utils.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-02-05 17:38:33 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2021-03-03 19:11:08 +0000
commitf943edb0c40d20e1330450c3e148b8d0c877eded (patch)
tree431e07e6b3bd22712c7e493c90301107f01fe84d /compiler/GHC/StgToCmm/Utils.hs
parent7b9767b81f4f0b25b0c0402593be1182b9546bab (diff)
downloadhaskell-f943edb0c40d20e1330450c3e148b8d0c877eded.tar.gz
IPE: Give all constructor and function tables locationswip/con-info
During testing it was observed that quite a few info tables were not being given locations (due to not being assigned source locations, because they were not enclosed by a source note). We can at least give the module name and type for such closures even if no more accurate source information. Especially for constructors this helps find them in the STG dumps.
Diffstat (limited to 'compiler/GHC/StgToCmm/Utils.hs')
-rw-r--r--compiler/GHC/StgToCmm/Utils.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index 8472711753..86d8a8d842 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -96,6 +96,7 @@ import qualified Data.List.NonEmpty as NE
import GHC.Core.DataCon
import GHC.Types.Unique.FM
import GHC.Data.Maybe
+import Control.Monad
-------------------------------------------------------------------------
--
@@ -662,7 +663,7 @@ convertInfoProvMap dflags defns this_mod (InfoTableProvMap (UniqMap dcenv) denv)
lookupClosureMap :: Maybe InfoProvEnt
lookupClosureMap = case hasHaskellName cl >>= lookupUniqMap denv of
- Just (ty, ss, l) -> Just (InfoProvEnt cl cn (tyString ty) this_mod (Just (ss, l)))
+ Just (ty, mbspan) -> Just (InfoProvEnt cl cn (tyString ty) this_mod mbspan)
Nothing -> Nothing
lookupDataConMap = do
@@ -670,7 +671,7 @@ convertInfoProvMap dflags defns this_mod (InfoTableProvMap (UniqMap dcenv) denv)
-- This is a bit grimy, relies on the DataCon and Name having the same Unique, which they do
(dc, ns) <- (hasHaskellName cl >>= lookupUFM_Directly dcenv . getUnique)
-- Lookup is linear but lists will be small (< 100)
- return $ InfoProvEnt cl cn (tyString (dataConTyCon dc)) this_mod (lookup n (NE.toList ns))
+ return $ InfoProvEnt cl cn (tyString (dataConTyCon dc)) this_mod (join $ lookup n (NE.toList ns))
-- This catches things like prim closure types and anything else which doesn't have a
-- source location