Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC

Commits:

22 changed files:

Changes:

  • compiler/GHC/Core/Coercion.hs
    ... ... @@ -147,6 +147,7 @@ import GHC.Types.Basic
    147 147
     import GHC.Types.Unique
    
    148 148
     import GHC.Data.FastString
    
    149 149
     import GHC.Data.Pair
    
    150
    +import GHC.Data.Unboxed (traverseMaybeUB)
    
    150 151
     import GHC.Types.SrcLoc
    
    151 152
     import GHC.Builtin.KnownKeys
    
    152 153
     import GHC.Builtin.WiredIn.Prim
    
    ... ... @@ -166,6 +167,7 @@ import Data.Char( isDigit )
    166 167
     import qualified Data.Monoid as Monoid
    
    167 168
     import Data.List.NonEmpty ( NonEmpty (..) )
    
    168 169
     import Control.DeepSeq
    
    170
    +import GHC.Exts (inline)
    
    169 171
     
    
    170 172
     {-
    
    171 173
     %************************************************************************
    
    ... ... @@ -722,6 +724,19 @@ isReflexiveCo_maybe co
    722 724
       = Nothing
    
    723 725
       where (Pair ty1 ty2, r) = coercionKindRole co
    
    724 726
     
    
    727
    +-- | Like @\\ cos -> map fst <$> traverse isReflCo_maybe cos@,
    
    728
    +-- but avoiding wasteful allocations (see #27648).
    
    729
    +reflCos_maybe :: [Coercion] -> Maybe [Type]
    
    730
    +reflCos_maybe =
    
    731
    +  traverseMaybeUB
    
    732
    +    ( fmap fst
    
    733
    +    . inline isReflCo_maybe
    
    734
    +        -- isReflCo_maybe must inline so that 'fmap fst' fuses and the whole
    
    735
    +        -- function inlines into 'traverseMaybeUB'
    
    736
    +    )
    
    737
    +{-# INLINE reflCos_maybe #-}
    
    738
    +  -- to avoid allocating the result's 'Just' constructor application
    
    739
    +
    
    725 740
     forAllCoKindCo :: TyCoVar -> KindMCoercion -> KindCoercion
    
    726 741
     -- Get the kind coercion from a ForAllCo
    
    727 742
     forAllCoKindCo _   (MCo co) = co
    
    ... ... @@ -811,8 +826,8 @@ mkTyConAppCo r tc cos
    811 826
       | ExpandsSyn tv_co_prs rhs_ty leftover_cos <- expandSynTyCon_maybe tc cos
    
    812 827
       = mkAppCos (liftCoSubst r (mkLiftingContext tv_co_prs) rhs_ty) leftover_cos
    
    813 828
     
    
    814
    -  | Just tys_roles <- traverse isReflCo_maybe cos
    
    815
    -  = mkReflCo r (mkTyConApp tc (map fst tys_roles))
    
    829
    +  | Just tys <- reflCos_maybe cos
    
    830
    +  = mkReflCo r $! mkTyConApp tc tys
    
    816 831
       -- See Note [Refl invariant]
    
    817 832
     
    
    818 833
       | otherwise = TyConAppCo r tc cos
    

  • compiler/GHC/Data/Unboxed.hs
    ... ... @@ -13,10 +13,11 @@
    13 13
     
    
    14 14
     module GHC.Data.Unboxed (
    
    15 15
       MaybeUB(JustUB, NothingUB),
    
    16
    -  fmapMaybeUB, fromMaybeUB, apMaybeUB, maybeUB
    
    16
    +  fmapMaybeUB, fromMaybeUB, apMaybeUB, maybeUB,
    
    17
    +  traverseMaybeUB
    
    17 18
       ) where
    
    18 19
     
    
    19
    -import GHC.Prelude hiding (Maybe(..), Either(..))
    
    20
    +import GHC.Prelude
    
    20 21
     
    
    21 22
     -- | Like Maybe, but using unboxed sums.
    
    22 23
     --
    
    ... ... @@ -54,3 +55,28 @@ fmapMaybeUB f (JustUB x) = JustUB $ f x
    54 55
     maybeUB :: b -> (a -> b) -> MaybeUB a -> b
    
    55 56
     maybeUB _def f (JustUB x) = f x
    
    56 57
     maybeUB def _f NothingUB = def
    
    58
    +
    
    59
    +toMaybe :: MaybeUB a -> Maybe a
    
    60
    +toMaybe NothingUB = Nothing
    
    61
    +toMaybe (JustUB a) = Just a
    
    62
    +
    
    63
    +-- | Like 'traverse' for the 'Maybe' applicative, but avoiding intermediate
    
    64
    +-- allocations.
    
    65
    +--
    
    66
    +-- The passed-in function must inline for this to help at all.
    
    67
    +traverseMaybeUB
    
    68
    +  :: forall a b
    
    69
    +  .  (a -> Maybe b) -- ^ @INLINE@ function to map over the list
    
    70
    +  -> [a] -> Maybe [b]
    
    71
    +{-# INLINE traverseMaybeUB #-}
    
    72
    +  -- 'traverseMaybeUB' must inline so that the function it is passed can inline
    
    73
    +traverseMaybeUB f = \ xs -> toMaybe $ go xs
    
    74
    +  where
    
    75
    +    go :: [a] -> MaybeUB [b]
    
    76
    +    go [] = JustUB []
    
    77
    +    go (a:as)
    
    78
    +      | Just b <- f a -- f is assumed to inline
    
    79
    +      , JustUB bs <- go as
    
    80
    +      = JustUB (b:bs)
    
    81
    +      | otherwise
    
    82
    +      = NothingUB

  • compiler/GHC/Parser.y
    ... ... @@ -1796,10 +1796,10 @@ cvars1 :: { [RecordPatSynField GhcPs] }
    1796 1796
     where_decls :: { LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList) }
    
    1797 1797
             : 'where' '{' decls '}'       {% amsA' (sLL $1 $> (thdOf3 $ unLoc $3,
    
    1798 1798
                                                     epTok $1,
    
    1799
    -                                                AnnList (Just (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3) [])) }
    
    1799
    +                                                AnnList (Just (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3))) }
    
    1800 1800
             | 'where' vocurly decls close {% amsA' (sLL $1 $3 (thdOf3 $ unLoc $3,
    
    1801 1801
                                                     epTok $1,
    
    1802
    -                                                AnnList (Just (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3) [])) }
    
    1802
    +                                                AnnList (Just (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3))) }
    
    1803 1803
     
    
    1804 1804
     pattern_synonym_sig :: { LSig GhcPs }
    
    1805 1805
             : 'pattern' con_list '::' sigtype
    
    ... ... @@ -1935,9 +1935,9 @@ decls :: { Located (EpaLocation, [EpToken ";"], OrdList (LHsDecl GhcPs)) }
    1935 1935
             | {- empty -}                   { noLoc (noAnn, [],nilOL) }
    
    1936 1936
     
    
    1937 1937
     decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
    
    1938
    -        : '{'            decls '}'     { sLL $1 $> (AnnList (Just (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2) []
    
    1938
    +        : '{'            decls '}'     { sLL $1 $> (AnnList (Just (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2)
    
    1939 1939
                                                        ,sL1 $2 $ thdOf3 $ unLoc $2) }
    
    1940
    -        |     vocurly    decls close   { sL1 $2    (AnnList (Just (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2) []
    
    1940
    +        |     vocurly    decls close   { sL1 $2    (AnnList (Just (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2)
    
    1941 1941
                                                        ,sL1 $2 $ thdOf3 $ unLoc $2) }
    
    1942 1942
     
    
    1943 1943
     -- Binding groups other than those of class and instance declarations
    
    ... ... @@ -1945,16 +1945,16 @@ decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
    1945 1945
     binds   ::  { Located (HsLocalBinds GhcPs) }
    
    1946 1946
                                              -- May have implicit parameters
    
    1947 1947
                                                     -- No type declarations
    
    1948
    -        : decllist          {% do { let { (AnnList anc p s t, decls) = unLoc $1 }
    
    1948
    +        : decllist          {% do { let { (AnnList anc p s, decls) = unLoc $1 }
    
    1949 1949
                                       ; val_binds <- cvBindGroup (unLoc $ decls)
    
    1950 1950
                                       ; !cs <- getCommentsFor (gl $1)
    
    1951
    -                                  ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList anc p s t) cs, NoEpTok) val_binds)} }
    
    1951
    +                                  ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList anc p s) cs, NoEpTok) val_binds)} }
    
    1952 1952
     
    
    1953 1953
             | '{'            dbinds '}'     {% acs (comb3 $1 $2 $3) (\loc cs -> (L loc
    
    1954
    -                                             $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (Just$ glR $2) (ListBraces (epTok $1) (epTok $3)) [] []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1954
    +                                             $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (Just$ glR $2) (ListBraces (epTok $1) (epTok $3)) []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1955 1955
     
    
    1956 1956
             |     vocurly    dbinds close   {% acs (gl $2) (\loc cs -> (L loc
    
    1957
    -                                             $ HsIPBinds (EpAnn (glR $1) (AnnList (Just $ glR $2) ListNone [] []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1957
    +                                             $ HsIPBinds (EpAnn (glR $1) (AnnList (Just $ glR $2) ListNone []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1958 1958
     
    
    1959 1959
     
    
    1960 1960
     wherebinds :: { Maybe (Located (HsLocalBinds GhcPs, Maybe EpAnnComments )) }
    
    ... ... @@ -3282,7 +3282,7 @@ aexp2 :: { ECP }
    3282 3282
             -- arrow notation extension
    
    3283 3283
             | '(|' aexp cmdargs '|)'  {% runPV (unECP $2) >>= \ $2 ->
    
    3284 3284
                                           fmap ecpFromCmd $
    
    3285
    -                                      amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (ListBanana (epUniTok $1) (epUniTok $4)) [] []) $2 Prefix
    
    3285
    +                                      amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (ListBanana (epUniTok $1) (epUniTok $4)) []) $2 Prefix
    
    3286 3286
                                                                (reverse $3)) }
    
    3287 3287
     
    
    3288 3288
     projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) }
    
    ... ... @@ -3414,9 +3414,9 @@ tup_tail :: { forall b. DisambECP b => PV [Either (EpAnn Bool) (LocatedA b)] }
    3414 3414
     -- Never empty.
    
    3415 3415
     list :: { forall b. DisambECP b => SrcSpan -> (EpaLocation, EpaLocation) -> PV (LocatedA b) }
    
    3416 3416
             : texp    { \loc (ao,ac) -> unECP $1 >>= \ $1 ->
    
    3417
    -                            mkHsExplicitListPV loc [$1] (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] []) }
    
    3417
    +                            mkHsExplicitListPV loc [$1] (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) []) }
    
    3418 3418
             | lexps   { \loc (ao,ac) -> $1 >>= \ $1 ->
    
    3419
    -                            mkHsExplicitListPV loc (reverse $1) (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] []) }
    
    3419
    +                            mkHsExplicitListPV loc (reverse $1) (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) []) }
    
    3420 3420
             | texp '..'  { \loc (ao,ac) -> unECP $1 >>= \ $1 ->
    
    3421 3421
                                       amsA' (L loc $ ArithSeq  (AnnArithSeq (EpTok ao) Nothing (epTok $2) (EpTok ac)) Nothing (From $1))
    
    3422 3422
                                           >>= ecpFromExp' }
    
    ... ... @@ -3440,7 +3440,7 @@ list :: { forall b. DisambECP b => SrcSpan -> (EpaLocation, EpaLocation) -> PV (
    3440 3440
                  { \loc (ao,ac) ->
    
    3441 3441
                     checkMonadComp >>= \ ctxt ->
    
    3442 3442
                     unECP $1 >>= \ $1 -> do { t <- addTrailingVbarA $1 (epTok $2)
    
    3443
    -                ; amsA' (L loc $ mkHsCompAnns ctxt (unLoc $3) t (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] [], noAnn))
    
    3443
    +                ; amsA' (L loc $ mkHsCompAnns ctxt (unLoc $3) t (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [], noAnn))
    
    3444 3444
                         >>= ecpFromExp' } }
    
    3445 3445
     
    
    3446 3446
     lexps :: { forall b. DisambECP b => PV [LocatedA b] }
    
    ... ... @@ -3546,11 +3546,11 @@ guardquals1 :: { Located [LStmt GhcPs (LHsExpr GhcPs)] }
    3546 3546
     altslist(PATS) :: { forall b. DisambECP b => PV (LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)) }
    
    3547 3547
             : '{'        alts(PATS) '}'    { $2 >>= \ $2 -> amsA'
    
    3548 3548
                                                (sLL $1 $> (reverse (snd $ unLoc $2),
    
    3549
    -                                           (AnnList (Just $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2) []))) }
    
    3549
    +                                           (AnnList (Just $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)))) }
    
    3550 3550
             | vocurly    alts(PATS)  close { $2 >>= \ $2 -> amsA'
    
    3551 3551
                                                (L (getLoc $2) (reverse (snd $ unLoc $2),
    
    3552
    -                                           (AnnList (Just $ glR $2) ListNone (fst $ unLoc $2) []))) }
    
    3553
    -        | '{'              '}'   { amsA' (sLL $1 $> ([], (AnnList Nothing (ListBraces (epTok $1) (epTok $2)) [] []))) }
    
    3552
    +                                           (AnnList (Just $ glR $2) ListNone (fst $ unLoc $2)))) }
    
    3553
    +        | '{'              '}'   { amsA' (sLL $1 $> ([], (AnnList Nothing (ListBraces (epTok $1) (epTok $2)) []))) }
    
    3554 3554
             | vocurly          close { return $ noLocA ([], noAnn) }
    
    3555 3555
     
    
    3556 3556
     alts(PATS) :: { forall b. DisambECP b => PV (Located ([EpToken ";"],[LMatch GhcPs (LocatedA b)])) }
    
    ... ... @@ -4727,7 +4727,7 @@ commentsPA la@(L l a) = do
    4727 4727
     
    
    4728 4728
     hsDoAnn :: EpToken "rec" -> (EpToken "{", [EpToken ";"], EpToken "}") -> LocatedAn t b -> (AnnList, EpToken "rec")
    
    4729 4729
     hsDoAnn rec (ob, semis, cb) (L ll _)
    
    4730
    -  = (AnnList (Just $ spanAsAnchor (locA ll)) (ListBraces ob cb) semis [], rec)
    
    4730
    +  = (AnnList (Just $ spanAsAnchor (locA ll)) (ListBraces ob cb) semis, rec)
    
    4731 4731
     
    
    4732 4732
     listAsAnchorM :: [LocatedAn t a] -> Maybe EpaLocation
    
    4733 4733
     listAsAnchorM [] = Nothing
    

  • compiler/GHC/Parser/Annotation.hs
    ... ... @@ -43,7 +43,7 @@ module GHC.Parser.Annotation (
    43 43
     
    
    44 44
       -- ** Trailing annotations in lists
    
    45 45
       TrailingAnn(..), ta_location,
    
    46
    -  addTrailingAnnToA, addTrailingAnnToL, addTrailingCommaToN,
    
    46
    +  addTrailingAnnToA, addTrailingCommaToN,
    
    47 47
       addTrailingAnnToBF,
    
    48 48
       noTrailingN,
    
    49 49
     
    
    ... ... @@ -529,10 +529,7 @@ data AnnList
    529 529
       = AnnList {
    
    530 530
           al_anchor    :: !(Maybe EpaLocation), -- ^ start point of a list having layout
    
    531 531
           al_brackets  :: !AnnListBrackets,
    
    532
    -      al_semis     :: [EpToken ";"], -- decls
    
    533
    -      al_trailing  :: ![TrailingAnn] -- ^ items appearing after the
    
    534
    -                                     -- list, such as '=>' for a
    
    535
    -                                     -- context
    
    532
    +      al_semis     :: [EpToken ";"] -- decls
    
    536 533
           } deriving (Data,Eq)
    
    537 534
     
    
    538 535
     data AnnListBrackets
    
    ... ... @@ -672,16 +669,6 @@ data AnnPragSCC
    672 669
     
    
    673 670
     -- ---------------------------------------------------------------------
    
    674 671
     
    
    675
    --- | Helper function used in the parser to add a 'TrailingAnn' items
    
    676
    --- to an existing annotation.
    
    677
    -addTrailingAnnToL :: TrailingAnn -> EpAnnComments
    
    678
    -                  -> EpAnn AnnList -> EpAnn AnnList
    
    679
    -addTrailingAnnToL t cs n = n { anns = addTrailing (anns n)
    
    680
    -                               , comments = comments n <> cs }
    
    681
    -  where
    
    682
    -    -- See Note [list append in addTrailing*]
    
    683
    -    addTrailing n = n { al_trailing = al_trailing n ++ [t]}
    
    684
    -
    
    685 672
     addTrailingAnnToBF :: TrailingAnn -> EpAnnComments
    
    686 673
                       -> EpAnn AnnBooleanFormula -> EpAnn AnnBooleanFormula
    
    687 674
     addTrailingAnnToBF t cs n = n { anns = addTrailing (anns n)
    
    ... ... @@ -714,7 +701,7 @@ noTrailingN s = s { anns = (anns s) { nann_trailing = [] } }
    714 701
     {-
    
    715 702
     Note [list append in addTrailing*]
    
    716 703
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    717
    -The addTrailingAnnToL, addTrailingAnnToA and addTrailingCommaToN
    
    704
    +The addTrailingAnnToA and addTrailingCommaToN
    
    718 705
     functions are used to add a separator for an item when it occurs in a
    
    719 706
     list.  So they are used to capture a comma, vbar, semicolon and similar.
    
    720 707
     
    
    ... ... @@ -1047,7 +1034,7 @@ instance NoAnn AnnBooleanFormula where
    1047 1034
       noAnn = AnnBooleanFormula noAnn noAnn []
    
    1048 1035
     
    
    1049 1036
     instance NoAnn AnnList where
    
    1050
    -  noAnn = AnnList Nothing ListNone noAnn []
    
    1037
    +  noAnn = AnnList Nothing ListNone noAnn
    
    1051 1038
     
    
    1052 1039
     instance NoAnn NameAnn where
    
    1053 1040
       noAnn = NameAnnTrailing []
    
    ... ... @@ -1141,8 +1128,8 @@ instance Outputable NameAnn where
    1141 1128
         = text "NameAnnTrailing" <+> ppr t
    
    1142 1129
     
    
    1143 1130
     instance Outputable AnnList where
    
    1144
    -  ppr (AnnList anc p s t)
    
    1145
    -    = text "AnnList" <+> ppr anc <+> ppr p <+> ppr s <+> ppr t
    
    1131
    +  ppr (AnnList l p s)
    
    1132
    +    = text "AnnList" <+> ppr l <+> ppr p <+> ppr s
    
    1146 1133
     
    
    1147 1134
     instance Outputable AnnListBrackets where
    
    1148 1135
       ppr (ListParens o c) = text "ListParens" <+> ppr o <+> ppr c
    

  • compiler/GHC/Parser/PostProcess.hs
    ... ... @@ -437,7 +437,7 @@ mkRoleAnnotDecl loc tycon roles anns
    437 437
     
    
    438 438
     mkMDo :: (EpToken "{", [EpToken ";"], EpToken "}") -> HsDoFlavour -> LocatedA [ExprLStmt GhcPs] -> EpaLocation -> EpaLocation -> HsExpr GhcPs
    
    439 439
     mkMDo (ob, semis, cb) ctxt stmts tok loc
    
    440
    -  = mkHsDoAnns ctxt stmts (AnnList (Just loc) (ListBraces ob cb) semis [], tok)
    
    440
    +  = mkHsDoAnns ctxt stmts (AnnList (Just loc) (ListBraces ob cb) semis, tok)
    
    441 441
     
    
    442 442
     -- | Converts a list of 'LHsTyVarBndr's annotated with their 'Specificity' to
    
    443 443
     -- binders without annotations. Only accepts specified variables, and errors if
    
    ... ... @@ -1963,7 +1963,7 @@ instance DisambECP (HsCmd GhcPs) where
    1963 1963
         return $ L (EpAnn (spanAsAnchor l) noAnn cs) (mkHsCmdIf c a b anns)
    
    1964 1964
       mkHsDoPV l (ob,semis,cb) Nothing stmts tok_loc anc = do
    
    1965 1965
         !cs <- getCommentsFor l
    
    1966
    -    return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsCmdDo (AnnList (Just anc) (ListBraces ob cb) semis [], tok_loc) stmts)
    
    1966
    +    return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsCmdDo (AnnList (Just anc) (ListBraces ob cb) semis, tok_loc) stmts)
    
    1967 1967
       mkHsDoPV l _ (Just m) _ _ _ = addFatalError $ mkPlainErrorMsgEnvelope l $ PsErrQualifiedDoInCmd m
    
    1968 1968
       mkHsParPV l lpar c rpar = do
    
    1969 1969
         !cs <- getCommentsFor l
    
    ... ... @@ -2062,7 +2062,7 @@ instance DisambECP (HsExpr GhcPs) where
    2062 2062
         return $ L (EpAnn (spanAsAnchor l) noAnn cs) (mkHsIf c a b anns)
    
    2063 2063
       mkHsDoPV l (ob,semis,cb) mod stmts loc_tok anc = do
    
    2064 2064
         !cs <- getCommentsFor l
    
    2065
    -    return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsDo (AnnList (Just anc) (ListBraces ob cb) semis [], loc_tok) (DoExpr mod) stmts)
    
    2065
    +    return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsDo (AnnList (Just anc) (ListBraces ob cb) semis, loc_tok) (DoExpr mod) stmts)
    
    2066 2066
       mkHsParPV l lpar e rpar = do
    
    2067 2067
         !cs <- getCommentsFor l
    
    2068 2068
         return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsPar (lpar, rpar) e)
    

  • testsuite/tests/count-deps/CountDepsParser.stdout
    ... ... @@ -86,6 +86,7 @@ GHC.Data.Pair
    86 86
     GHC.Data.Strict
    
    87 87
     GHC.Data.StringBuffer
    
    88 88
     GHC.Data.TrieMap
    
    89
    +GHC.Data.Unboxed
    
    89 90
     GHC.Data.Word64Map
    
    90 91
     GHC.Data.Word64Map.Internal
    
    91 92
     GHC.Data.Word64Map.Lazy
    

  • testsuite/tests/ghc-api/exactprint/T22919.stderr
    ... ... @@ -71,7 +71,6 @@
    71 71
             (AnnList
    
    72 72
              (Nothing)
    
    73 73
              (ListNone)
    
    74
    -         []
    
    75 74
              []))
    
    76 75
            (L
    
    77 76
             (EpAnn
    

  • testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
    ... ... @@ -83,7 +83,6 @@
    83 83
             (AnnList
    
    84 84
              (Nothing)
    
    85 85
              (ListNone)
    
    86
    -         []
    
    87 86
              []))
    
    88 87
            (L
    
    89 88
             (EpAnn
    

  • testsuite/tests/module/mod185.stderr
    ... ... @@ -95,7 +95,6 @@
    95 95
             (AnnList
    
    96 96
              (Nothing)
    
    97 97
              (ListNone)
    
    98
    -         []
    
    99 98
              []))
    
    100 99
            (L
    
    101 100
             (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpParsedAst.stderr
    ... ... @@ -2124,7 +2124,6 @@
    2124 2124
             (AnnList
    
    2125 2125
              (Nothing)
    
    2126 2126
              (ListNone)
    
    2127
    -         []
    
    2128 2127
              []))
    
    2129 2128
            (L
    
    2130 2129
             (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
    ... ... @@ -91,7 +91,6 @@
    91 91
             (AnnList
    
    92 92
              (Nothing)
    
    93 93
              (ListNone)
    
    94
    -         []
    
    95 94
              []))
    
    96 95
            (L
    
    97 96
             (EpAnn
    
    ... ... @@ -214,7 +213,6 @@
    214 213
             (AnnList
    
    215 214
              (Nothing)
    
    216 215
              (ListNone)
    
    217
    -         []
    
    218 216
              []))
    
    219 217
            (L
    
    220 218
             (EpAnn
    
    ... ... @@ -294,7 +292,6 @@
    294 292
                        (ListBraces
    
    295 293
                         (NoEpTok)
    
    296 294
                         (NoEpTok))
    
    297
    -                   []
    
    298 295
                        [])
    
    299 296
                       (EpaSpan { DumpParsedAstComments.hs:14:7-8 }))
    
    300 297
                      (DoExpr
    
    ... ... @@ -364,7 +361,6 @@
    364 361
             (AnnList
    
    365 362
              (Nothing)
    
    366 363
              (ListNone)
    
    367
    -         []
    
    368 364
              []))
    
    369 365
            (L
    
    370 366
             (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
    ... ... @@ -32,7 +32,6 @@
    32 32
                 (AnnList
    
    33 33
                  (Nothing)
    
    34 34
                  (ListNone)
    
    35
    -             []
    
    36 35
                  []))
    
    37 36
                (L
    
    38 37
                 (EpAnn
    

  • testsuite/tests/parser/should_compile/DumpSemis.stderr
    ... ... @@ -259,7 +259,6 @@
    259 259
             (AnnList
    
    260 260
              (Nothing)
    
    261 261
              (ListNone)
    
    262
    -         []
    
    263 262
              []))
    
    264 263
            (L
    
    265 264
             (EpAnn
    
    ... ... @@ -333,7 +332,6 @@
    333 332
                        (ListBraces
    
    334 333
                         (NoEpTok)
    
    335 334
                         (NoEpTok))
    
    336
    -                   []
    
    337 335
                        [])
    
    338 336
                       (EpaSpan { DumpSemis.hs:10:7-8 }))
    
    339 337
                      (DoExpr
    
    ... ... @@ -373,8 +371,7 @@
    373 371
                              ,(EpTok
    
    374 372
                                (EpaSpan { DumpSemis.hs:11:10 }))
    
    375 373
                              ,(EpTok
    
    376
    -                           (EpaSpan { DumpSemis.hs:11:11 }))]
    
    377
    -                         [])
    
    374
    +                           (EpaSpan { DumpSemis.hs:11:11 }))])
    
    378 375
                             (EpaSpan { DumpSemis.hs:11:3-4 }))
    
    379 376
                            (DoExpr
    
    380 377
                             (Nothing))
    
    ... ... @@ -554,7 +551,6 @@
    554 551
             (AnnList
    
    555 552
              (Nothing)
    
    556 553
              (ListNone)
    
    557
    -         []
    
    558 554
              []))
    
    559 555
            (L
    
    560 556
             (EpAnn
    
    ... ... @@ -631,8 +627,7 @@
    631 627
                        [(EpTok
    
    632 628
                          (EpaSpan { DumpSemis.hs:16:5 }))
    
    633 629
                        ,(EpTok
    
    634
    -                     (EpaSpan { DumpSemis.hs:16:8 }))]
    
    635
    -                   [])
    
    630
    +                     (EpaSpan { DumpSemis.hs:16:8 }))])
    
    636 631
                       (EpaSpan { DumpSemis.hs:15:7-8 }))
    
    637 632
                      (DoExpr
    
    638 633
                       (Nothing))
    
    ... ... @@ -806,7 +801,6 @@
    806 801
             (AnnList
    
    807 802
              (Nothing)
    
    808 803
              (ListNone)
    
    809
    -         []
    
    810 804
              []))
    
    811 805
            (L
    
    812 806
             (EpAnn
    
    ... ... @@ -883,8 +877,7 @@
    883 877
                        [(EpTok
    
    884 878
                          (EpaSpan { DumpSemis.hs:22:12 }))
    
    885 879
                        ,(EpTok
    
    886
    -                     (EpaSpan { DumpSemis.hs:22:13 }))]
    
    887
    -                   [])
    
    880
    +                     (EpaSpan { DumpSemis.hs:22:13 }))])
    
    888 881
                       (EpaSpan { DumpSemis.hs:22:7-8 }))
    
    889 882
                      (DoExpr
    
    890 883
                       (Nothing))
    
    ... ... @@ -1015,7 +1008,6 @@
    1015 1008
             (AnnList
    
    1016 1009
              (Nothing)
    
    1017 1010
              (ListNone)
    
    1018
    -         []
    
    1019 1011
              []))
    
    1020 1012
            (L
    
    1021 1013
             (EpAnn
    
    ... ... @@ -1120,7 +1112,6 @@
    1120 1112
             (AnnList
    
    1121 1113
              (Nothing)
    
    1122 1114
              (ListNone)
    
    1123
    -         []
    
    1124 1115
              []))
    
    1125 1116
            (L
    
    1126 1117
             (EpAnn
    
    ... ... @@ -1227,7 +1218,6 @@
    1227 1218
             (AnnList
    
    1228 1219
              (Nothing)
    
    1229 1220
              (ListNone)
    
    1230
    -         []
    
    1231 1221
              []))
    
    1232 1222
            (L
    
    1233 1223
             (EpAnn
    
    ... ... @@ -1718,7 +1708,6 @@
    1718 1708
             (AnnList
    
    1719 1709
              (Nothing)
    
    1720 1710
              (ListNone)
    
    1721
    -         []
    
    1722 1711
              []))
    
    1723 1712
            (L
    
    1724 1713
             (EpAnn
    
    ... ... @@ -1844,7 +1833,6 @@
    1844 1833
             (AnnList
    
    1845 1834
              (Nothing)
    
    1846 1835
              (ListNone)
    
    1847
    -         []
    
    1848 1836
              []))
    
    1849 1837
            (L
    
    1850 1838
             (EpAnn
    
    ... ... @@ -1935,8 +1923,7 @@
    1935 1923
                          ,(EpTok
    
    1936 1924
                            (EpaSpan { DumpSemis.hs:34:17 }))
    
    1937 1925
                          ,(EpTok
    
    1938
    -                       (EpaSpan { DumpSemis.hs:34:18 }))]
    
    1939
    -                     [])
    
    1926
    +                       (EpaSpan { DumpSemis.hs:34:18 }))])
    
    1940 1927
                         (EpaComments
    
    1941 1928
                          []))
    
    1942 1929
                        (NoEpTok))
    
    ... ... @@ -1971,7 +1958,6 @@
    1971 1958
                              (AnnList
    
    1972 1959
                               (Nothing)
    
    1973 1960
                               (ListNone)
    
    1974
    -                          []
    
    1975 1961
                               []))
    
    1976 1962
                             (L
    
    1977 1963
                              (EpAnn
    
    ... ... @@ -2084,7 +2070,6 @@
    2084 2070
                              (AnnList
    
    2085 2071
                               (Nothing)
    
    2086 2072
                               (ListNone)
    
    2087
    -                          []
    
    2088 2073
                               []))
    
    2089 2074
                             (L
    
    2090 2075
                              (EpAnn
    
    ... ... @@ -2209,7 +2194,6 @@
    2209 2194
             (AnnList
    
    2210 2195
              (Nothing)
    
    2211 2196
              (ListNone)
    
    2212
    -         []
    
    2213 2197
              []))
    
    2214 2198
            (L
    
    2215 2199
             (EpAnn
    
    ... ... @@ -2328,8 +2312,7 @@
    2328 2312
                         ,(EpTok
    
    2329 2313
                           (EpaSpan { DumpSemis.hs:38:7 }))
    
    2330 2314
                         ,(EpTok
    
    2331
    -                      (EpaSpan { DumpSemis.hs:38:8 }))]
    
    2332
    -                    []))
    
    2315
    +                      (EpaSpan { DumpSemis.hs:38:8 }))]))
    
    2333 2316
                       (L
    
    2334 2317
                        (EpAnn
    
    2335 2318
                         (EpaSpan { DumpSemis.hs:(38,4)-(44,4) })
    

  • testsuite/tests/parser/should_compile/KindSigs.stderr
    ... ... @@ -964,7 +964,6 @@
    964 964
             (AnnList
    
    965 965
              (Nothing)
    
    966 966
              (ListNone)
    
    967
    -         []
    
    968 967
              []))
    
    969 968
            (L
    
    970 969
             (EpAnn
    
    ... ... @@ -1664,7 +1663,6 @@
    1664 1663
             (AnnList
    
    1665 1664
              (Nothing)
    
    1666 1665
              (ListNone)
    
    1667
    -         []
    
    1668 1666
              []))
    
    1669 1667
            (L
    
    1670 1668
             (EpAnn
    

  • testsuite/tests/parser/should_compile/T15279.stderr
    ... ... @@ -154,7 +154,6 @@
    154 154
             (AnnList
    
    155 155
              (Nothing)
    
    156 156
              (ListNone)
    
    157
    -         []
    
    158 157
              []))
    
    159 158
            (L
    
    160 159
             (EpAnn
    

  • testsuite/tests/parser/should_compile/T20718.stderr
    ... ... @@ -105,7 +105,6 @@
    105 105
             (AnnList
    
    106 106
              (Nothing)
    
    107 107
              (ListNone)
    
    108
    -         []
    
    109 108
              []))
    
    110 109
            (L
    
    111 110
             (EpAnn
    

  • testsuite/tests/parser/should_compile/T20846.stderr
    ... ... @@ -95,7 +95,6 @@
    95 95
             (AnnList
    
    96 96
              (Nothing)
    
    97 97
              (ListNone)
    
    98
    -         []
    
    99 98
              []))
    
    100 99
            (L
    
    101 100
             (EpAnn
    

  • testsuite/tests/printer/Test20297.stdout
    ... ... @@ -71,7 +71,6 @@
    71 71
             (AnnList
    
    72 72
              (Nothing)
    
    73 73
              (ListNone)
    
    74
    -         []
    
    75 74
              []))
    
    76 75
            (L
    
    77 76
             (EpAnn
    
    ... ... @@ -163,7 +162,6 @@
    163 162
                     (Just
    
    164 163
                      (EpaSpan { Test20297.hs:7:3-7 }))
    
    165 164
                     (ListNone)
    
    166
    -                []
    
    167 165
                     [])
    
    168 166
                    (EpaComments
    
    169 167
                     []))
    
    ... ... @@ -203,7 +201,6 @@
    203 201
             (AnnList
    
    204 202
              (Nothing)
    
    205 203
              (ListNone)
    
    206
    -         []
    
    207 204
              []))
    
    208 205
            (L
    
    209 206
             (EpAnn
    
    ... ... @@ -289,7 +286,6 @@
    289 286
                     (Just
    
    290 287
                      (EpaSpan { Test20297.hs:11:9-26 }))
    
    291 288
                     (ListNone)
    
    292
    -                []
    
    293 289
                     [])
    
    294 290
                    (EpaComments
    
    295 291
                     [(L
    
    ... ... @@ -327,7 +323,6 @@
    327 323
                         (AnnList
    
    328 324
                          (Nothing)
    
    329 325
                          (ListNone)
    
    330
    -                     []
    
    331 326
                          []))
    
    332 327
                        (L
    
    333 328
                         (EpAnn
    
    ... ... @@ -401,7 +396,6 @@
    401 396
                                    (ListBraces
    
    402 397
                                     (NoEpTok)
    
    403 398
                                     (NoEpTok))
    
    404
    -                               []
    
    405 399
                                    [])
    
    406 400
                                   (EpaSpan { Test20297.hs:11:19-20 }))
    
    407 401
                                  (DoExpr
    
    ... ... @@ -517,7 +511,6 @@
    517 511
             (AnnList
    
    518 512
              (Nothing)
    
    519 513
              (ListNone)
    
    520
    -         []
    
    521 514
              []))
    
    522 515
            (L
    
    523 516
             (EpAnn
    
    ... ... @@ -603,7 +596,6 @@
    603 596
                     (Just
    
    604 597
                      (EpaSpan { Test20297.ppr.hs:5:3-7 }))
    
    605 598
                     (ListNone)
    
    606
    -                []
    
    607 599
                     [])
    
    608 600
                    (EpaComments
    
    609 601
                     []))
    
    ... ... @@ -637,7 +629,6 @@
    637 629
             (AnnList
    
    638 630
              (Nothing)
    
    639 631
              (ListNone)
    
    640
    -         []
    
    641 632
              []))
    
    642 633
            (L
    
    643 634
             (EpAnn
    
    ... ... @@ -723,7 +714,6 @@
    723 714
                     (Just
    
    724 715
                      (EpaSpan { Test20297.ppr.hs:9:7-24 }))
    
    725 716
                     (ListNone)
    
    726
    -                []
    
    727 717
                     [])
    
    728 718
                    (EpaComments
    
    729 719
                     []))
    
    ... ... @@ -755,7 +745,6 @@
    755 745
                         (AnnList
    
    756 746
                          (Nothing)
    
    757 747
                          (ListNone)
    
    758
    -                     []
    
    759 748
                          []))
    
    760 749
                        (L
    
    761 750
                         (EpAnn
    
    ... ... @@ -829,7 +818,6 @@
    829 818
                                    (ListBraces
    
    830 819
                                     (NoEpTok)
    
    831 820
                                     (NoEpTok))
    
    832
    -                               []
    
    833 821
                                    [])
    
    834 822
                                   (EpaSpan { Test20297.ppr.hs:9:17-18 }))
    
    835 823
                                  (DoExpr
    

  • testsuite/tests/printer/Test24533.stdout
    ... ... @@ -521,7 +521,6 @@
    521 521
                  (AnnList
    
    522 522
                   (Nothing)
    
    523 523
                   (ListNone)
    
    524
    -              []
    
    525 524
                   []))
    
    526 525
                 (L
    
    527 526
                  (EpAnn
    
    ... ... @@ -1093,7 +1092,6 @@
    1093 1092
                  (AnnList
    
    1094 1093
                   (Nothing)
    
    1095 1094
                   (ListNone)
    
    1096
    -              []
    
    1097 1095
                   []))
    
    1098 1096
                 (L
    
    1099 1097
                  (EpAnn
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -281,8 +281,8 @@ instance HasTrailing EpAnnSumPat where
    281 281
       setTrailing a _ = a
    
    282 282
     
    
    283 283
     instance HasTrailing AnnList where
    
    284
    -  trailing a = al_trailing a
    
    285
    -  setTrailing a ts = a { al_trailing = ts }
    
    284
    +  trailing _ = []
    
    285
    +  setTrailing a _ = a
    
    286 286
     
    
    287 287
     instance HasTrailing [TrailingAnn] where
    
    288 288
       trailing a = a
    

  • utils/check-exact/Main.hs
    ... ... @@ -524,8 +524,8 @@ changeLocalDecls libdir (L l p) = do
    524 524
             let oldDecls' = captureLineSpacing oldDecls
    
    525 525
             let (VbSig o:oldBinds)  = map wrapValBind oldDecls'
    
    526 526
                 o' = setEntryDP o (DifferentLine 2 0)
    
    527
    -        let (EpAnn anc (AnnList (Just _) a b dd) cs) = van
    
    528
    -        let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b dd) cs)
    
    527
    +        let (EpAnn anc (AnnList (Just _) a b) cs) = van
    
    528
    +        let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b) cs)
    
    529 529
             let binds' = (HsValBinds (van',w)
    
    530 530
                               (ValBinds noExtField (VbSig sig':VbBind decl':VbSig o':oldBinds)))
    
    531 531
             return (L lm (Match an mln pats (GRHSs emptyComments rhs binds')))
    
    ... ... @@ -552,7 +552,6 @@ changeLocalDecls2 libdir (L l p) = do
    552 552
             let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 4) [])
    
    553 553
             let an = (EpAnn anc
    
    554 554
                             (AnnList (Just anc2) ListNone
    
    555
    -                                 []
    
    556 555
                                      [])
    
    557 556
                             emptyComments, EpTok (EpaDelta noSrcSpan (SameLine 0) []))
    
    558 557
             let decls = [VbSig sig', VbBind decl']
    

  • utils/check-exact/Transform.hs
    ... ... @@ -1096,7 +1096,7 @@ oldWhereAnnotation (EpAnn anc an cs, _w) ww _oldSpan = an'
    1096 1096
       -- TODO: when we set DP (0,0) for the HsValBinds EpEpaLocation,
    
    1097 1097
       -- change the AnnList anchor to have the correct DP too
    
    1098 1098
       where
    
    1099
    -    (AnnList ancl p s t) = an
    
    1099
    +    (AnnList ancl p s) = an
    
    1100 1100
         w = case ww of
    
    1101 1101
           WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
    
    1102 1102
           WithoutWhere -> NoEpTok
    
    ... ... @@ -1105,7 +1105,7 @@ oldWhereAnnotation (EpAnn anc an cs, _w) ww _oldSpan = an'
    1105 1105
                 WithWhere -> (anc, ancl)
    
    1106 1106
                 WithoutWhere -> (anc, ancl)
    
    1107 1107
         an' = (EpAnn anc'
    
    1108
    -                 (AnnList ancl' p s t)
    
    1108
    +                 (AnnList ancl' p s)
    
    1109 1109
                      cs, w)
    
    1110 1110
     
    
    1111 1111
     newWhereAnnotation :: WithWhere -> (EpAnn AnnList, EpToken "where")
    
    ... ... @@ -1117,7 +1117,7 @@ newWhereAnnotation ww = (an, w)
    1117 1117
         WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
    
    1118 1118
         WithoutWhere -> NoEpTok
    
    1119 1119
       an = EpAnn anc
    
    1120
    -              (AnnList (Just anc2) ListNone [] [])
    
    1120
    +              (AnnList (Just anc2) ListNone [])
    
    1121 1121
                   emptyComments
    
    1122 1122
     
    
    1123 1123
     -- ---------------------------------------------------------------------