diff options
Diffstat (limited to 'compiler/GHC/Types/IPE.hs')
-rw-r--r-- | compiler/GHC/Types/IPE.hs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/compiler/GHC/Types/IPE.hs b/compiler/GHC/Types/IPE.hs index c69aeb004a..461bae6a55 100644 --- a/compiler/GHC/Types/IPE.hs +++ b/compiler/GHC/Types/IPE.hs @@ -1,5 +1,10 @@ -module GHC.Types.IPE(DCMap, ClosureMap, InfoTableProvMap(..) - , emptyInfoTableProvMap) where +module GHC.Types.IPE ( + DCMap, + ClosureMap, + InfoTableProvMap(..), + emptyInfoTableProvMap, + IpeSourceLocation +) where import GHC.Prelude @@ -10,11 +15,17 @@ import GHC.Core.DataCon import GHC.Types.Unique.Map import GHC.Core.Type import Data.List.NonEmpty +import GHC.Cmm.CLabel (CLabel) +import qualified Data.Map.Strict as Map + +-- | Position and information about an info table. +-- For return frames these are the contents of a 'CoreSyn.SourceNote'. +type IpeSourceLocation = (RealSrcSpan, String) -- | A map from a 'Name' to the best approximate source position that -- name arose from. type ClosureMap = UniqMap Name -- The binding - (Type, Maybe (RealSrcSpan, String)) + (Type, Maybe IpeSourceLocation) -- The best approximate source position. -- (rendered type, source position, source note -- label) @@ -26,11 +37,15 @@ type ClosureMap = UniqMap Name -- The binding -- the constructor was used at, if possible and a string which names -- the source location. This is the same information as is the payload -- for the 'GHC.Core.SourceNote' constructor. -type DCMap = UniqMap DataCon (NonEmpty (Int, Maybe (RealSrcSpan, String))) +type DCMap = UniqMap DataCon (NonEmpty (Int, Maybe IpeSourceLocation)) + +type InfoTableToSourceLocationMap = Map.Map CLabel (Maybe IpeSourceLocation) data InfoTableProvMap = InfoTableProvMap { provDC :: DCMap - , provClosure :: ClosureMap } + , provClosure :: ClosureMap + , provInfoTables :: InfoTableToSourceLocationMap + } emptyInfoTableProvMap :: InfoTableProvMap -emptyInfoTableProvMap = InfoTableProvMap emptyUniqMap emptyUniqMap +emptyInfoTableProvMap = InfoTableProvMap emptyUniqMap emptyUniqMap Map.empty |