X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=NormalizeTypes.hs;h=56cba91a411666a078e0eed852ffe5c084fea0f9;hb=aa23b0116eaf65b01499cd1eba93a92f7c8c36e8;hp=e959bbba42fe5e067278668cfca6ce1c048e3450;hpb=ce21f6b5bc31049d9f663bab7c0f7984ccec5875;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/NormalizeTypes.hs b/NormalizeTypes.hs index e959bbb..56cba91 100644 --- a/NormalizeTypes.hs +++ b/NormalizeTypes.hs @@ -20,11 +20,13 @@ import Outputable ( Outputable, showSDoc, ppr ) -- Local imports import CoreShow import Pretty +import VHDLTypes -- For TypeState data TransformState = TransformState { tsUniqSupply_ :: UniqSupply.UniqSupply , tsBindings_ :: Map.Map CoreBndr CoreExpr , tsNormalized_ :: VarSet.VarSet -- ^ The binders that have been normalized + , tsType_ :: TypeState } $( Data.Accessor.Template.deriveAccessors ''TransformState ) @@ -47,3 +49,9 @@ getGlobalBind bndr = do -- Adds a new global binding with the given value addGlobalBind :: CoreBndr -> CoreExpr -> TransformSession () addGlobalBind bndr expr = modA tsBindings (Map.insert bndr expr) + +-- Returns a list of all global binders +getGlobalBinders :: TransformSession [CoreBndr] +getGlobalBinders = do + bindings <- getA tsBindings + return $ Map.keys bindings