From 745d6b8e16c7f276f479c18d97200e44d16aafc9 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 24 Jul 2022 19:08:49 -0700 Subject: Start codegen. --- csc/ir2.csc | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'csc/ir2.csc') diff --git a/csc/ir2.csc b/csc/ir2.csc index 30fb5a3..642b86c 100644 --- a/csc/ir2.csc +++ b/csc/ir2.csc @@ -5,15 +5,13 @@ %closure %fix %globals + %label %primitive %variable *globals* apply-arguments apply-procedure apply? - atom-continuation - atom-expression - atom? branch-atom branch-false branch-true @@ -30,21 +28,14 @@ fix-functions fix? globals? - kargs-expression - kargs-refs - kargs? - klabel-expression - klabel? - ktail? + label-gensym + label? make-apply - make-atom make-branch make-call-closure make-closure make-fix - make-kargs - make-klabel - make-ktail + make-label make-primitive make-variable primitive-arguments @@ -56,23 +47,27 @@ variable? ; Re-exports from IR1. + %constant + %library-ref constant-expression constant? lexical-ref-gensym lexical-ref-name lexical-ref? + lexical-set-expression + lexical-set-ref + lexical-set? library-ref-library library-ref-name library-ref? make-constant make-lexical-ref - lexical-set-expression - lexical-set-ref - lexical-set? make-lexical-set make-library-ref) (import (scheme base) (only (csc ir1) + %constant + %library-ref constant? lexical-ref-gensym lexical-ref-name @@ -130,6 +125,14 @@ (define *globals* (make-globals)) + ; A label, used for function names and will compile to a constant. + (define-match-record-type