From ee3788d35edd1a6107a2b5e0c1d7172234f7a640 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 24 Jul 2020 22:39:29 +0200 Subject: Define builtins in backend --- backend/CC/Backend/Dumb.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backend/CC/Backend/Dumb.hs (limited to 'backend') diff --git a/backend/CC/Backend/Dumb.hs b/backend/CC/Backend/Dumb.hs new file mode 100644 index 0000000..070fece --- /dev/null +++ b/backend/CC/Backend/Dumb.hs @@ -0,0 +1,14 @@ +module CC.Backend.Dumb(builtins) where + +import CC.AST.Typed +import CC.Context + + +builtins :: Builtins +builtins = Builtins + [ ("print", TFunT TIntT (TTupT [])) + , ("fst", TFunT (TTupT [TyVar 1, TyVar 2]) (TyVar 1)) + , ("snd", TFunT (TTupT [TyVar 1, TyVar 2]) (TyVar 2)) + , ("_add", TFunT TIntT (TFunT TIntT TIntT)) + , ("_sub", TFunT TIntT (TFunT TIntT TIntT)) + , ("_mul", TFunT TIntT (TFunT TIntT TIntT)) ] -- cgit v1.2.3-70-g09d2