... |
... |
@@ -2666,10 +2666,10 @@ runBc hsc_env this_mod modBreaks (BcM m) |
2666
|
2666
|
= m (BcM_Env hsc_env this_mod modBreaks) (BcM_State 0 0 (mkInternalModBreaks this_mod mempty))
|
2667
|
2667
|
|
2668
|
2668
|
instance HasDynFlags BcM where
|
2669
|
|
- getDynFlags = BcM $ \st -> return (st, hsc_dflags (bcm_hsc_env st))
|
|
2669
|
+ getDynFlags = hsc_dflags <$> getHscEnv
|
2670
|
2670
|
|
2671
|
2671
|
getHscEnv :: BcM HscEnv
|
2672
|
|
-getHscEnv = BcM $ \st -> return (st, bcm_hsc_env st)
|
|
2672
|
+getHscEnv = BcM $ \env st -> return (st, bcm_hsc_env env)
|
2673
|
2673
|
|
2674
|
2674
|
getProfile :: BcM Profile
|
2675
|
2675
|
getProfile = targetProfile <$> getDynFlags
|
... |
... |
@@ -2682,16 +2682,16 @@ shouldAddBcoName = do |
2682
|
2682
|
else return Nothing
|
2683
|
2683
|
|
2684
|
2684
|
getLabelBc :: BcM LocalLabel
|
2685
|
|
-getLabelBc
|
2686
|
|
- = BcM $ \st -> do let nl = nextlabel st
|
2687
|
|
- when (nl == maxBound) $
|
2688
|
|
- panic "getLabelBc: Ran out of labels"
|
2689
|
|
- return (st{nextlabel = nl + 1}, LocalLabel nl)
|
|
2685
|
+getLabelBc = BcM $ \_ st ->
|
|
2686
|
+ do let nl = nextlabel st
|
|
2687
|
+ when (nl == maxBound) $
|
|
2688
|
+ panic "getLabelBc: Ran out of labels"
|
|
2689
|
+ return (st{nextlabel = nl + 1}, LocalLabel nl)
|
2690
|
2690
|
|
2691
|
2691
|
getLabelsBc :: Word32 -> BcM [LocalLabel]
|
2692
|
|
-getLabelsBc n
|
2693
|
|
- = BcM $ \st -> let ctr = nextlabel st
|
2694
|
|
- in return (st{nextlabel = ctr+n}, coerce [ctr .. ctr+n-1])
|
|
2692
|
+getLabelsBc n = BcM $ \_ st ->
|
|
2693
|
+ let ctr = nextlabel st
|
|
2694
|
+ in return (st{nextlabel = ctr+n}, coerce [ctr .. ctr+n-1])
|
2695
|
2695
|
|
2696
|
2696
|
newBreakInfo :: CgBreakInfo -> BcM InternalBreakpointId
|
2697
|
2697
|
newBreakInfo info = BcM $ \env st ->
|
... |
... |
@@ -2704,7 +2704,7 @@ newBreakInfo info = BcM $ \env st -> |
2704
|
2704
|
in return (st', ibi)
|
2705
|
2705
|
|
2706
|
2706
|
getCurrentModule :: BcM Module
|
2707
|
|
-getCurrentModule = BcM $ \st -> return (st, thisModule st)
|
|
2707
|
+getCurrentModule = BcM $ \env st -> return (st, thisModule env)
|
2708
|
2708
|
|
2709
|
2709
|
tickFS :: FastString
|
2710
|
2710
|
tickFS = fsLit "ticked" |