Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • compiler/GHC/HsToCore/Ticks.hs
    ... ... @@ -583,7 +583,11 @@ addTickHsExpr (HsProc x pat cmdtop) =
    583 583
     addTickHsExpr (XExpr (WrapExpr w e)) =
    
    584 584
             liftM (XExpr . WrapExpr w) $
    
    585 585
                   (addTickHsExpr e)        -- Explicitly no tick on inside
    
    586
    -addTickHsExpr (XExpr (ExpandedThingTc o e)) = addTickHsExpanded o e
    
    586
    +addTickHsExpr (XExpr (ExpandedThingTc o e)) =
    
    587
    +        liftM (XExpr . ExpandedThingTc o) $
    
    588
    +              (addTickHsExpr e)        -- Explicitly no tick on inside
    
    589
    +
    
    590
    +  -- addTickHsExpanded o e
    
    587 591
     
    
    588 592
     
    
    589 593
     addTickHsExpr e@(XExpr (ConLikeTc {})) = return e
    
    ... ... @@ -607,24 +611,24 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts))
    607 611
                         ListComp -> Just $ BinBox QualBinBox
    
    608 612
                         _        -> Nothing
    
    609 613
     
    
    610
    -addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc)
    
    611
    -addTickHsExpanded o e = liftM (XExpr . ExpandedThingTc o) $ case o of
    
    612
    -  -- We always want statements to get a tick, so we can step over each one.
    
    613
    -  -- To avoid duplicates we blacklist SrcSpans we already inserted here.
    
    614
    -  OrigStmt (L pos _) _ -> do_tick_black pos
    
    615
    -  _                    -> skip
    
    616
    -  where
    
    617
    -    skip = addTickHsExpr e
    
    618
    -    do_tick_black pos = do
    
    619
    -      d <- getDensity
    
    620
    -      case d of
    
    621
    -         TickForCoverage    -> tick_it_black pos
    
    622
    -         TickForBreakPoints -> tick_it_black pos
    
    623
    -         _                  -> skip
    
    624
    -    tick_it_black pos =
    
    625
    -      unLoc <$> allocTickBox (ExpBox False) False False (locA pos)
    
    626
    -                             (withBlackListed (locA pos) $
    
    627
    -                               addTickHsExpr e)
    
    614
    +-- addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc)
    
    615
    +-- addTickHsExpanded o e = liftM (XExpr . ExpandedThingTc o) $ case o of
    
    616
    +--   -- We always want statements to get a tick, so we can step over each one.
    
    617
    +--   -- To avoid duplicates we blacklist SrcSpans we already inserted here.
    
    618
    +--   OrigStmt (L pos _) _ -> do_tick_black pos
    
    619
    +--   _                    -> skip
    
    620
    +--   where
    
    621
    +--     skip = addTickHsExpr e
    
    622
    +--     do_tick_black pos = do
    
    623
    +--       d <- getDensity
    
    624
    +--       case d of
    
    625
    +--          TickForCoverage    -> tick_it_black pos
    
    626
    +--          TickForBreakPoints -> tick_it_black pos
    
    627
    +--          _                  -> skip
    
    628
    +--     tick_it_black pos =
    
    629
    +--       unLoc <$> allocTickBox (ExpBox False) False False (locA pos)
    
    630
    +--                              (withBlackListed (locA pos) $
    
    631
    +--                                addTickHsExpr e)
    
    628 632
     
    
    629 633
     addTickTupArg :: HsTupArg GhcTc -> TM (HsTupArg GhcTc)
    
    630 634
     addTickTupArg (Present x e)  = do { e' <- addTickLHsExpr e
    

  • compiler/GHC/Tc/Instance/Class.hs
    ... ... @@ -22,7 +22,7 @@ import GHC.Tc.Instance.Typeable
    22 22
     import GHC.Tc.Utils.TcMType
    
    23 23
     import GHC.Tc.Types.Evidence
    
    24 24
     import GHC.Tc.Types.CtLoc
    
    25
    -import GHC.Tc.Types.Origin ( InstanceWhat (..), SafeOverlapping, CtOrigin(GetFieldOrigin) )
    
    25
    +import GHC.Tc.Types.Origin ( InstanceWhat (..), SafeOverlapping, CtOrigin(OccurrenceOf) )
    
    26 26
     import GHC.Tc.Instance.Family( tcGetFamInstEnvs, tcInstNewTyCon_maybe, tcLookupDataFamInst, FamInstEnvs )
    
    27 27
     import GHC.Rename.Env( addUsedGRE, addUsedDataCons, DeprecationWarnings (..) )
    
    28 28
     
    
    ... ... @@ -1327,7 +1327,7 @@ warnIncompleteRecSel dflags sel_id ct_loc
    1327 1327
     
    
    1328 1328
         -- GHC.Tc.Gen.App.tcInstFun arranges that the CtOrigin of (r.x) is GetFieldOrigin,
    
    1329 1329
         -- despite the expansion to (getField @"x" r)
    
    1330
    -    isGetFieldOrigin (GetFieldOrigin {}) = True
    
    1330
    +    isGetFieldOrigin (OccurrenceOf f)    = f `hasKey` getFieldClassOpKey
    
    1331 1331
         isGetFieldOrigin _                   = False
    
    1332 1332
     
    
    1333 1333
     lookupHasFieldLabel