mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
Fixup module renaming
This commit is contained in:
parent
86fb869c5a
commit
dad7a459ce
4 changed files with 24 additions and 16 deletions
2
Makefile
2
Makefile
|
@ -104,7 +104,7 @@ bootstrap: icyc
|
||||||
cp icyc.scm $(BOOTSTRAP_DIR)
|
cp icyc.scm $(BOOTSTRAP_DIR)
|
||||||
cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
|
cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
|
||||||
cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/optimize-cps.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/cps-optimizations.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
|
|
14
cyclone.scm
14
cyclone.scm
|
@ -18,7 +18,7 @@
|
||||||
(scheme cyclone util)
|
(scheme cyclone util)
|
||||||
(scheme cyclone cgen)
|
(scheme cyclone cgen)
|
||||||
(scheme cyclone transforms)
|
(scheme cyclone transforms)
|
||||||
(scheme cyclone cps-optimizations)
|
; (scheme cyclone cps-optimizations)
|
||||||
(scheme cyclone macros)
|
(scheme cyclone macros)
|
||||||
(scheme cyclone libraries))
|
(scheme cyclone libraries))
|
||||||
|
|
||||||
|
@ -222,11 +222,6 @@
|
||||||
(trace:info "---------------- after CPS:")
|
(trace:info "---------------- after CPS:")
|
||||||
(trace:info input-program) ;pretty-print
|
(trace:info input-program) ;pretty-print
|
||||||
|
|
||||||
|
|
||||||
;; TODO: do not run this if eval is in play, or (better) only do opts that are safe in that case (will be much more limited)
|
|
||||||
;; because of this, programs such as icyc can only be so optimized. it would be much more beneficial if modules like
|
|
||||||
;; eval.scm could be compiled separately and then linked to by a program such as icyc.scm. that would save a *lot* of compile
|
|
||||||
;; time. in fact, it might be more beneficial than adding these optimizations.
|
|
||||||
;;
|
;;
|
||||||
;; TODO: run CPS optimization (not all of these phases may apply)
|
;; TODO: run CPS optimization (not all of these phases may apply)
|
||||||
;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once,
|
;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once,
|
||||||
|
@ -240,9 +235,10 @@
|
||||||
;; TODO: re-run phases again until program is stable (less than n opts made, more than r rounds performed, etc)
|
;; TODO: re-run phases again until program is stable (less than n opts made, more than r rounds performed, etc)
|
||||||
;; END CPS optimization
|
;; END CPS optimization
|
||||||
|
|
||||||
(analyze-cps input-program)
|
; (set! input-program
|
||||||
(trace:info "---------------- cps analysis db:")
|
; (optimize-cps input-program))
|
||||||
(trace:info (adb:get-db))
|
; (trace:info "---------------- after cps optimizations:")
|
||||||
|
; (trace:info input-program)
|
||||||
|
|
||||||
; (set! input-program
|
; (set! input-program
|
||||||
; (map
|
; (map
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
(srfi 69))
|
(srfi 69))
|
||||||
(export
|
(export
|
||||||
analyze-cps
|
analyze-cps
|
||||||
|
opt:contract
|
||||||
;adb:init!
|
;adb:init!
|
||||||
adb:get
|
adb:get
|
||||||
adb:get/default
|
adb:get/default
|
||||||
|
@ -81,11 +82,6 @@
|
||||||
(define (adb:make-fnc)
|
(define (adb:make-fnc)
|
||||||
(%adb:make-fnc '? '?))
|
(%adb:make-fnc '? '?))
|
||||||
|
|
||||||
(define (analyze-cps exp)
|
|
||||||
(analyze exp -1) ;; Top-level is lambda ID -1
|
|
||||||
(analyze2 exp) ;; Second pass
|
|
||||||
)
|
|
||||||
|
|
||||||
(define (analyze exp lid)
|
(define (analyze exp lid)
|
||||||
;(tre:error `(analyze ,lid ,exp))
|
;(tre:error `(analyze ,lid ,exp))
|
||||||
(cond
|
(cond
|
||||||
|
@ -230,4 +226,20 @@
|
||||||
formals)
|
formals)
|
||||||
(not (any-nonlocal-refs? id formals))
|
(not (any-nonlocal-refs? id formals))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
;; Perform contraction phase of CPS optimizations
|
||||||
|
(define (opt:contract ast)
|
||||||
|
ast) ;'TODO)
|
||||||
|
|
||||||
|
(define (analyze-cps exp)
|
||||||
|
(analyze exp -1) ;; Top-level is lambda ID -1
|
||||||
|
(analyze2 exp) ;; Second pass
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (optimize-cps ast)
|
||||||
|
(analyze-cps input-program)
|
||||||
|
(trace:info "---------------- cps analysis db:")
|
||||||
|
(trace:info (adb:get-db))
|
||||||
|
(opt:contract ast)
|
||||||
|
)
|
||||||
))
|
))
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
(scheme cyclone common)
|
(scheme cyclone common)
|
||||||
(scheme cyclone libraries)
|
(scheme cyclone libraries)
|
||||||
(scheme cyclone macros)
|
(scheme cyclone macros)
|
||||||
(scheme cyclone optimize-cps)
|
;(scheme cyclone optimize-cps)
|
||||||
(scheme cyclone pretty-print)
|
(scheme cyclone pretty-print)
|
||||||
(scheme cyclone util)
|
(scheme cyclone util)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue