X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=NormalizeTools.hs;h=0508b38162aab5381bf025e62b6679f8f901573a;hb=aa23b0116eaf65b01499cd1eba93a92f7c8c36e8;hp=85fae47e8f66a19865f281ee25e642d9dca1f16f;hpb=35d10dbd4dcd24f3bd8a46e3a359d6f16dccfd32;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/NormalizeTools.hs b/NormalizeTools.hs index 85fae47..0508b38 100644 --- a/NormalizeTools.hs +++ b/NormalizeTools.hs @@ -30,11 +30,13 @@ import qualified IdInfo import qualified CoreUtils import qualified CoreSubst import qualified VarSet +import qualified HscTypes import Outputable ( showSDoc, ppr, nest ) -- Local imports import NormalizeTypes import Pretty +import VHDLTypes import qualified VHDLTools -- Create a new internal var with the given name and type. A Unique is @@ -246,8 +248,11 @@ substitute ((b, e):subss) expr = substitute subss' expr' -- Run a given TransformSession. Used mostly to setup the right calls and -- an initial state. -runTransformSession :: UniqSupply.UniqSupply -> TransformSession a -> a -runTransformSession uniqSupply session = State.evalState session (emptyTransformState uniqSupply) +runTransformSession :: HscTypes.HscEnv -> UniqSupply.UniqSupply -> TransformSession a -> a +runTransformSession env uniqSupply session = State.evalState session emptyTransformState + where + emptyTypeState = TypeState Map.empty [] Map.empty Map.empty env + emptyTransformState = TransformState uniqSupply Map.empty VarSet.emptyVarSet emptyTypeState -- Is the given expression representable at runtime, based on the type? isRepr :: CoreSyn.CoreExpr -> TransformMonad Bool