X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize%2FNormalizeTools.hs;fp=c%CE%BBash%2FCLasH%2FNormalize%2FNormalizeTools.hs;h=9ca2aa081587eed2b78b1a2c6825cf4c43f4eae4;hb=042536460e46c13ab24363b2a8e44eb46d2e7be4;hp=c774a335f34f01b65fd9f6b1c51c17f29655702c;hpb=d54117f6de8d00fe0ce7552c905cf197678d7ed7;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" index c774a33..9ca2aa0 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" @@ -100,23 +100,6 @@ subeverywhere trans c (Cast expr ty) = do subeverywhere trans c expr = error $ "\nNormalizeTools.subeverywhere: Unsupported expression: " ++ show expr --- Apply the given transformation to all expressions, except for direct --- arguments of an application -notappargs :: (String, Transform) -> Transform -notappargs trans = applyboth (subnotappargs trans) trans - --- Apply the given transformation to all (direct and indirect) subexpressions --- (but not the expression itself), except for direct arguments of an --- application -subnotappargs :: (String, Transform) -> Transform -subnotappargs trans c (App a b) = do - a' <- subnotappargs trans (Other:c) a - b' <- subnotappargs trans (Other:c) b - return $ App a' b' - --- Let subeverywhere handle all other expressions -subnotappargs trans c expr = subeverywhere (notappargs trans) c expr - -- Runs each of the transforms repeatedly inside the State monad. dotransforms :: [Transform] -> CoreExpr -> TranslatorSession CoreExpr dotransforms transs expr = do