From: Matthijs Kooijman Date: Thu, 19 Feb 2009 13:26:13 +0000 (+0100) Subject: Do the naming of a signal in named function instead of a lambda. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=08a1265b63ba9af9a588b5c85e49883c5799dbe2;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Do the naming of a signal in named function instead of a lambda. --- diff --git a/Translator.hs b/Translator.hs index 26cf79d..0431823 100644 --- a/Translator.hs +++ b/Translator.hs @@ -1,5 +1,5 @@ module Translator where -import GHC hiding (loadModule) +import GHC hiding (loadModule, sigName) import CoreSyn import qualified CoreUtils import qualified Var @@ -221,9 +221,14 @@ nameFlatFunction hsfunc fdata = -- Name the signals in all other functions Just flatfunc -> let s = flat_sigs flatfunc in - let s' = map (\(id, (SignalInfo Nothing use ty hints)) -> (id, SignalInfo (Just $ "sig_" ++ (show id)) use ty hints)) s in + let s' = map nameSignal s in let flatfunc' = flatfunc { flat_sigs = s' } in setFlatFunc hsfunc flatfunc' + where + nameSignal :: (SignalId, SignalInfo) -> (SignalId, SignalInfo) + nameSignal (id, info) = + let name = "sig_" ++ (show id) in + (id, info {sigName = Just name}) -- | Splits a tuple type into a list of element types, or Nothing if the type -- is not a tuple type.