diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-02-25 23:57:12 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-02-25 23:57:12 +0100 |
commit | 36d87b4a0e0578fef8fcd3032856c1ebe85536b2 (patch) | |
tree | 758585c653d866b9f89bc401a7c3ba7bad1e3cdb | |
parent | 6a5055b7747424b8a05ad70354e68e42d680109a (diff) |
Comment unhandled cases instead of getting 1e6 warnings
-rw-r--r-- | src/Compile.hs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/Compile.hs b/src/Compile.hs index 95004b8..8d5fd13 100644 --- a/src/Compile.hs +++ b/src/Compile.hs @@ -326,23 +326,23 @@ compile' env = \case <> pure (SAsg retvar e3)))) return (CELit retvar) - EConstArr _ n t arr -> do - name <- emitStruct (STArr n (STScal t)) - error "TODO" + -- EConstArr _ n t arr -> do + -- name <- emitStruct (STArr n (STScal t)) + -- error "TODO" - EBuild _ n a b -> error "TODO" -- genStruct (STArr n (typeOf b)) <> EBuild ext n (compile' a) (compile' b) + -- EBuild _ n a b -> error "TODO" -- genStruct (STArr n (typeOf b)) <> EBuild ext n (compile' a) (compile' b) - EFold1Inner _ a b c -> error "TODO" -- EFold1Inner ext (compile' a) (compile' b) (compile' c) + -- EFold1Inner _ a b c -> error "TODO" -- EFold1Inner ext (compile' a) (compile' b) (compile' c) - ESum1Inner _ e -> error "TODO" -- ESum1Inner ext (compile' e) + -- ESum1Inner _ e -> error "TODO" -- ESum1Inner ext (compile' e) - EUnit _ e -> error "TODO" -- EUnit ext (compile' e) + -- EUnit _ e -> error "TODO" -- EUnit ext (compile' e) - EReplicate1Inner _ a b -> error "TODO" -- EReplicate1Inner ext (compile' a) (compile' b) + -- EReplicate1Inner _ a b -> error "TODO" -- EReplicate1Inner ext (compile' a) (compile' b) - EMaximum1Inner _ e -> error "TODO" -- EMaximum1Inner ext (compile' e) + -- EMaximum1Inner _ e -> error "TODO" -- EMaximum1Inner ext (compile' e) - EMinimum1Inner _ e -> error "TODO" -- EMinimum1Inner ext (compile' e) + -- EMinimum1Inner _ e -> error "TODO" -- EMinimum1Inner ext (compile' e) EConst _ t x -> case t of STI32 -> return $ CELit $ "(int32_t)" ++ show x @@ -351,13 +351,13 @@ compile' env = \case STF64 -> return $ CELit $ show x STBool -> return $ CELit $ if x then "true" else "false" - EIdx0 _ e -> error "TODO" -- EIdx0 ext (compile' e) + -- EIdx0 _ e -> error "TODO" -- EIdx0 ext (compile' e) - EIdx1 _ a b -> error "TODO" -- EIdx1 ext (compile' a) (compile' b) + -- EIdx1 _ a b -> error "TODO" -- EIdx1 ext (compile' a) (compile' b) - EIdx _ a b -> error "TODO" -- EIdx ext (compile' a) (compile' b) + -- EIdx _ a b -> error "TODO" -- EIdx ext (compile' a) (compile' b) - EShape _ e -> error "TODO" -- EShape ext (compile' e) + -- EShape _ e -> error "TODO" -- EShape ext (compile' e) EOp _ op (EPair _ e1 e2) -> do e1' <- compile' env e1 @@ -368,11 +368,11 @@ compile' env = \case e' <- compile' env e compileOpGeneral op e' - ECustom _ t1 t2 t3 a b c e1 e2 -> error "TODO" -- ECustom ext t1 t2 t3 (compile' a) (compile' b) (compile' c) (compile' e1) (compile' e2) + -- ECustom _ t1 t2 t3 a b c e1 e2 -> error "TODO" -- ECustom ext t1 t2 t3 (compile' a) (compile' b) (compile' c) (compile' e1) (compile' e2) - EWith _ a b -> error "TODO" -- EWith (compile' a) (compile' b) + -- EWith _ a b -> error "TODO" -- EWith (compile' a) (compile' b) - EAccum _ n a b e -> error "TODO" -- EAccum n (compile' a) (compile' b) (compile' e) + -- EAccum _ n a b e -> error "TODO" -- EAccum n (compile' a) (compile' b) (compile' e) EError _ t s -> do name <- emitStruct t @@ -384,6 +384,8 @@ compile' env = \case EPlus{} -> error "Compile: monoid operations should have been eliminated" EOneHot{} -> error "Compile: monoid operations should have been eliminated" + _ -> error "Compile: not implemented" + compileOpGeneral :: SOp a b -> CExpr -> CompM CExpr compileOpGeneral op e1 = do let unary cop = return @(State CompState) $ CECall cop [e1] |