aboutsummaryrefslogtreecommitdiff
path: root/backend/CC/Backend
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-24 22:39:29 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-24 22:39:29 +0200
commitee3788d35edd1a6107a2b5e0c1d7172234f7a640 (patch)
treed1e70f1a8d1cebdc1125013db6ceb9dfa23ae502 /backend/CC/Backend
parent96c29e2a5e2c97d2c40c46222d4593c366de953e (diff)
Define builtins in backend
Diffstat (limited to 'backend/CC/Backend')
-rw-r--r--backend/CC/Backend/Dumb.hs14
1 files changed, 14 insertions, 0 deletions
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)) ]