Ignore cast expressions when generating VHDL.
[matthijs/master-project/cλash.git] / NormalizeTools.hs
index 400bf88bfa503e12232ef5ddac1ff8868b01c20b..8e57ba8f2ec2446301ebcf22ec83e03f577470b7 100644 (file)
@@ -142,9 +142,16 @@ subeverywhere trans (Case scrut b t alts) = do
     transalt (con, binders, expr) = do
       expr' <- trans expr
       return (con, binders, expr')
-      
 
-subeverywhere trans expr = return expr
+subeverywhere trans (Var x) = return $ Var x
+subeverywhere trans (Lit x) = return $ Lit x
+subeverywhere trans (Type x) = return $ Type x
+
+subeverywhere trans (Cast expr ty) = do
+  expr' <- trans expr
+  return $ Cast expr' ty
+
+subeverywhere trans expr = error $ "NormalizeTools.subeverywhere Unsupported expression: " ++ show expr
 
 -- Apply the given transformation to all expressions, except for direct
 -- arguments of an application