-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.rkt
More file actions
33 lines (26 loc) · 943 Bytes
/
make.rkt
File metadata and controls
33 lines (26 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#lang racket
; Run this file or use the following at the REPL
(require "cps.rkt")
(require "utils.rkt")
(require "desugar.rkt")
(require "closure-convert.rkt")
(require "top-level.rkt")
;(define args (vector->list (current-command-line-arguments)))
(define fileName (make-parameter "bin"))
(define toCompile
(command-line
#:once-each
[("-o" "--output") file "Output file executable" (fileName file)]
#:args (filename) filename))
; Load the test we're testing, perhaps amb.scm
(define top (with-input-from-file toCompile read-begin #:mode 'text))
; Convert to cps, note that simplify-ir is added after the call to desugar
(define scm (top-level top))
;(display scm)
(define cps (cps-convert (anf-convert (alphatize (assignment-convert (simplify-ir (desugar scm)))))))
;(cps-exp? cps)
; Phases 1 and 2
(define p (closure-convert cps))
;(eval-proc p)
(define llvm (proc->llvm p))
(eval-llvm llvm #f (fileName))