diff options
-rw-r--r-- | compiler/GHC/Parser/Annotation.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs index 1692d394b5..ab0026d1a7 100644 --- a/compiler/GHC/Parser/Annotation.hs +++ b/compiler/GHC/Parser/Annotation.hs @@ -496,11 +496,11 @@ instance Outputable AddEpAnn where -- new AST fragments out of old ones, and have them still printed out -- in a precise way. data EpAnn ann - = EpAnn { entry :: Anchor + = EpAnn { entry :: !Anchor -- ^ Base location for the start of the syntactic element -- holding the annotations. - , anns :: ann -- ^ Annotations added by the Parser - , comments :: EpAnnComments + , anns :: !ann -- ^ Annotations added by the Parser + , comments :: !EpAnnComments -- ^ Comments enclosed in the SrcSpan of the element -- this `EpAnn` is attached to } @@ -567,7 +567,10 @@ emptyComments = EpaComments [] -- | The 'SrcSpanAnn\'' type wraps a normal 'SrcSpan', together with -- an extra annotation type. This is mapped to a specific `GenLocated` -- usage in the AST through the `XRec` and `Anno` type families. -data SrcSpanAnn' a = SrcSpanAnn { ann :: a, locA :: SrcSpan } + +-- Important that the fields are strict as these live inside L nodes which +-- are live for a long time. +data SrcSpanAnn' a = SrcSpanAnn { ann :: !a, locA :: !SrcSpan } deriving (Data, Eq) -- See Note [XRec and Anno in the AST] |