mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Issue #260 - No loop on branches allocing closures
This commit is contained in:
parent
596276f1ff
commit
0d53f329e9
1 changed files with 4 additions and 16 deletions
|
@ -724,18 +724,11 @@
|
||||||
(tagged-list? '%closure-ref fun)
|
(tagged-list? '%closure-ref fun)
|
||||||
(equal? (cadr fun) (cdr trace)) ;; Needed?
|
(equal? (cadr fun) (cdr trace)) ;; Needed?
|
||||||
(equal? (car args) (cdr trace))
|
(equal? (car args) (cdr trace))
|
||||||
|
;; Make sure continuation is not a lambda, because
|
||||||
|
;; that means a closure may be allocated
|
||||||
|
(ref? (cadr args))
|
||||||
)
|
)
|
||||||
(let* ((cgen-lis
|
(let* ((cgen-lis
|
||||||
;; TODO: need a way to get the original args to the top-level function
|
|
||||||
;; TODO: probably need a specilized function here instead
|
|
||||||
|
|
||||||
;(c-compile-args
|
|
||||||
; (cddr args) ;; Skip the closure
|
|
||||||
; append-preamble
|
|
||||||
; ""
|
|
||||||
; "" ;;this-cont
|
|
||||||
; trace
|
|
||||||
; cps?)
|
|
||||||
(map
|
(map
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(c-compile-exp e append-preamble "" "" cps?))
|
(c-compile-exp e append-preamble "" "" cps?))
|
||||||
|
@ -767,12 +760,7 @@
|
||||||
parent-args
|
parent-args
|
||||||
cgen-lis)))
|
cgen-lis)))
|
||||||
)
|
)
|
||||||
;;(trace:info `(loop ,cgen-lis ,parent-args))
|
;;(trace:info `(loop ,args ,(cadr args) ,cgen-lis ,parent-args))
|
||||||
;; Output so far on ntakl:
|
|
||||||
;;(loop (("Cyc_cdr(data, x_736_73133)" ())
|
|
||||||
;; ("Cyc_cdr(data, y_735_73132)" ()))
|
|
||||||
;; (k$241 x$6$133 y$5$132))
|
|
||||||
|
|
||||||
(c-code
|
(c-code
|
||||||
(string-append
|
(string-append
|
||||||
cgen-allocs ;(c:allocs->str (c:allocs cgen))
|
cgen-allocs ;(c:allocs->str (c:allocs cgen))
|
||||||
|
|
Loading…
Add table
Reference in a new issue