Commit 699f8e16 authored by ian@well-typed.com's avatar ian@well-typed.com

Remove getModuleDs; we now just use getModule

parent ba38f995
......@@ -42,6 +42,7 @@ import MkCore
import DynFlags
import CostCentre
import Id
import Module
import VarSet
import VarEnv
import DataCon
......@@ -296,7 +297,7 @@ dsExpr (ExplicitTuple tup_args boxity)
(map (Type . exprType) args ++ args) }
dsExpr (HsSCC cc expr@(L loc _)) = do
mod_name <- getModuleDs
mod_name <- getModule
count <- goptM Opt_ProfCountEntries
uniq <- newUnique
Tick (ProfNote (mkUserCC cc mod_name loc uniq) count True) <$> dsLExpr expr
......
......@@ -401,7 +401,7 @@ dsFExportDynamic :: Id
-> DsM ([Binding], SDoc, SDoc)
dsFExportDynamic id co0 cconv = do
fe_id <- newSysLocalDs ty
mod <- getModuleDs
mod <- getModule
dflags <- getDynFlags
let
-- hack: need to get at the name of the C stub we're about to generate.
......
......@@ -23,6 +23,7 @@ import DsMonad
import DsUtils
import TysWiredIn
import PrelNames
import Module
import Name
import SrcLoc
import Outputable
......@@ -146,7 +147,7 @@ isTrueLHsExpr (L _ (HsTick tickish e))
isTrueLHsExpr (L _ (HsBinTick ixT _ e))
| Just ticks <- isTrueLHsExpr e
= Just (\x -> do e <- ticks x
this_mod <- getModuleDs
this_mod <- getModule
return (Tick (HpcTick this_mod ixT) e))
isTrueLHsExpr (L _ (HsPar e)) = isTrueLHsExpr e
......
......@@ -16,7 +16,6 @@ module DsMonad (
duplicateLocalDs, newSysLocalDs, newSysLocalsDs, newUniqueId,
newFailLocalDs, newPredVarDs,
getSrcSpanDs, putSrcSpanDs,
getModuleDs,
mkPrintUnqualifiedDs,
newUnique,
UniqSupply, newUniqueSupply,
......@@ -352,9 +351,6 @@ the @SrcSpan@ being carried around.
getGhcModeDs :: DsM GhcMode
getGhcModeDs = getDynFlags >>= return . ghcMode
getModuleDs :: DsM Module
getModuleDs = do { env <- getGblEnv; return (ds_mod env) }
getSrcSpanDs :: DsM SrcSpan
getSrcSpanDs = do { env <- getLclEnv; return (ds_loc env) }
......
......@@ -67,6 +67,7 @@ import TysWiredIn
import BasicTypes
import UniqSet
import UniqSupply
import Module
import PrelNames
import Outputable
import SrcLoc
......@@ -759,7 +760,7 @@ mkOptTickBox (Just tickish) e = Tick tickish e
mkBinaryTickBox :: Int -> Int -> CoreExpr -> DsM CoreExpr
mkBinaryTickBox ixT ixF e = do
uq <- newUnique
this_mod <- getModuleDs
this_mod <- getModule
let bndr1 = mkSysLocal (fsLit "t1") uq boolTy
let
falseBox = Tick (HpcTick this_mod ixF) (Var falseDataConId)
......
......@@ -13,7 +13,7 @@ import BasicTypes
import CoreSyn
import CoreUtils
import CoreUnfold
import DsMonad
import Module
import TyCon
import Type
import Id
......@@ -58,7 +58,7 @@ buildPADict vect_tc prepr_ax pdata_tc pdatas_tc repr
= polyAbstract tvs $ \args -> -- The args are the dictionaries we lambda abstract over; and they
-- are put in the envt, so when we need a (PA a) we can find it in
-- the envt; they don't include the silent superclass args yet
do { mod <- liftDs getModuleDs
do { mod <- liftDs getModule
; let dfun_name = mkLocalisedOccName mod mkPADFunOcc vect_tc_name
-- The superclass dictionary is a (silent) argument if the tycon is polymorphic...
......
......@@ -19,6 +19,7 @@ import DsMonad
import TcType
import Type
import Var
import Module
import Name
import SrcLoc
import MkId
......@@ -37,7 +38,7 @@ import Control.Monad
--
mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name
mkLocalisedName mk_occ name
= do { mod <- liftDs getModuleDs
= do { mod <- liftDs getModule
; u <- liftDs newUnique
; let occ_name = mkLocalisedOccName mod mk_occ name
......@@ -86,7 +87,7 @@ cloneVar var = liftM (setIdUnique var) (liftDs newUnique)
--
newExportedVar :: OccName -> Type -> VM Var
newExportedVar occ_name ty
= do mod <- liftDs getModuleDs
= do mod <- liftDs getModule
u <- liftDs newUnique
let name = mkExternalName u mod occ_name noSrcSpan
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment