From: Matthijs Kooijman Date: Mon, 13 Jul 2009 09:52:44 +0000 (+0200) Subject: Add is_local_var predicate. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d0afb7276c06414c1930a2e76271239ebe9b93b0;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add is_local_var predicate. --- diff --git a/NormalizeTools.hs b/NormalizeTools.hs index 429a27c..1290fd8 100644 --- a/NormalizeTools.hs +++ b/NormalizeTools.hs @@ -258,3 +258,9 @@ runTransformSession env uniqSupply session = State.evalState session emptyTransf isRepr :: CoreSyn.CoreExpr -> TransformMonad Bool isRepr (Type ty) = return False isRepr expr = Trans.lift $ MonadState.lift tsType $ VHDLTools.isReprType (CoreUtils.exprType expr) + +is_local_var :: CoreSyn.CoreExpr -> TransformSession Bool +is_local_var (CoreSyn.Var v) = do + bndrs <- getGlobalBinders + return $ not $ v `elem` bndrs +is_local_var _ = return False