aboutsummaryrefslogtreecommitdiffstats
path: root/csc/ir1.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@google.com>2022-07-20 15:39:23 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-20 20:08:14 -0700
commite615308b928585013461482f879f536527c5acc2 (patch)
treedd00eef6713c103f755b98c5ffde1e2ca2d994f7 /csc/ir1.csc
parentAdd builtin operations to IR1. (diff)
downloadchromatopelma-e615308b928585013461482f879f536527c5acc2.tar.zst
Perform argument conversion.
The point of argument conversion is to validate on each function call that the right number of arguments were passed, and to ensure that no function has more than 1 argument. This second condition makes CPS slightly simpler, and ensures that the arguments will all fit in locals. We take the strategy of allocating a vector for each function call. Ideally we would optimize away most of these allocations, but for now I just want it to work.
Diffstat (limited to 'csc/ir1.csc')
-rw-r--r--csc/ir1.csc1
1 files changed, 1 insertions, 0 deletions
diff --git a/csc/ir1.csc b/csc/ir1.csc
index 484b38f..b91e8ab 100644
--- a/csc/ir1.csc
+++ b/csc/ir1.csc
@@ -168,6 +168,7 @@
; - alloc: size -> result
; - peek: pointer * offset -> result
; - poke: word * pointer * offset -> ()
+ ; - int<?: int * int -> bool
(define-match-record-type <call-builtin>
(make-call-builtin operation arguments)
call-builtin?