mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 00:37:35 +02:00
Test optimization changes
This commit is contained in:
parent
4e9a209f43
commit
4c2b56b19e
1 changed files with 10 additions and 9 deletions
|
@ -1458,9 +1458,10 @@
|
|||
ast)
|
||||
(else
|
||||
(cps ast '%halt)))))
|
||||
ast-cps))
|
||||
; ast-cps))
|
||||
;; TODO: use for temporary testing of optimizations
|
||||
; (cps-optimize-01 ast-cps)))
|
||||
;; eventually will want to call this explicitly from cyclone.scm
|
||||
(cps-optimize-01 ast-cps)))
|
||||
|
||||
;; CPS optimizations
|
||||
|
||||
|
@ -1469,13 +1470,13 @@
|
|||
(define (cps-optimize-01 exp)
|
||||
(define (opt-lambda exp)
|
||||
(let ((body (car (lambda->exp exp)))) ;; Single expr after CPS
|
||||
(trace:error `(DEBUG
|
||||
,exp
|
||||
,body
|
||||
,(if (and (pair? body) (app? body) (lambda? (car body)))
|
||||
(list (app->args body)
|
||||
(lambda->formals exp))
|
||||
#f)))
|
||||
;(trace:error `(DEBUG
|
||||
; ,exp
|
||||
; ,body
|
||||
; ,(if (and (pair? body) (app? body) (lambda? (car body)))
|
||||
; (list (app->args body)
|
||||
; (lambda->formals exp))
|
||||
; #f)))
|
||||
(cond
|
||||
;; Does the function just call its continuation?
|
||||
((and (pair? body)
|
||||
|
|
Loading…
Add table
Reference in a new issue