Commit e5182b7c authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Add replaceDynFlags to the ContainsDynFlags class

parent cea7aa33
......@@ -707,6 +707,7 @@ class HasDynFlags m where
class ContainsDynFlags t where
extractDynFlags :: t -> DynFlags
replaceDynFlags :: t -> DynFlags -> t
data ProfAuto
= NoProfAuto -- ^ no SCC annotations added
......
......@@ -326,6 +326,10 @@ data HscEnv
-- 'TcRunTypes.TcGblEnv'
}
instance ContainsDynFlags HscEnv where
extractDynFlags env = hsc_dflags env
replaceDynFlags env dflags = env {hsc_dflags = dflags}
-- | Retrieve the ExternalPackageState cache.
hscEPS :: HscEnv -> IO ExternalPackageState
hscEPS hsc_env = readIORef (hsc_EPS hsc_env)
......
......@@ -181,6 +181,8 @@ data Env gbl lcl
instance ContainsDynFlags (Env gbl lcl) where
extractDynFlags env = hsc_dflags (env_top env)
replaceDynFlags env dflags
= env {env_top = replaceDynFlags (env_top env) dflags}
instance ContainsModule gbl => ContainsModule (Env gbl lcl) where
extractModule env = extractModule (env_gbl env)
......
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