mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 07:17:37 +02:00
Compile args separately
This commit is contained in:
parent
b3ea8324bd
commit
a61ba42a1d
1 changed files with 23 additions and 11 deletions
|
@ -724,20 +724,32 @@
|
||||||
(equal? (cadr fun) (cdr trace)) ;; Needed?
|
(equal? (cadr fun) (cdr trace)) ;; Needed?
|
||||||
(equal? (car args) (cdr trace))
|
(equal? (car args) (cdr trace))
|
||||||
)
|
)
|
||||||
(let* ((cgen
|
(let* ((cgen-lis
|
||||||
;; TODO: skip the closure, just cdr the cdr???
|
;; TODO: need a way to get the original args to the top-level function
|
||||||
(c-compile-args
|
;; TODO: probably need a specilized function here instead
|
||||||
(cdr args)
|
|
||||||
append-preamble
|
;(c-compile-args
|
||||||
""
|
; (cddr args) ;; Skip the closure
|
||||||
"" ;;this-cont
|
; append-preamble
|
||||||
trace
|
; ""
|
||||||
cps?)))
|
; "" ;;this-cont
|
||||||
|
; trace
|
||||||
|
; cps?)
|
||||||
|
(map
|
||||||
|
(lambda (e)
|
||||||
|
(c-compile-exp e append-preamble "" "" cps?))
|
||||||
|
(cddr args)) ;; Skip the closure
|
||||||
|
)
|
||||||
|
(cgen-allocs
|
||||||
|
(apply string-append
|
||||||
|
(map (lambda (a) (c:allocs->str (c:allocs a))) cgen-lis)))
|
||||||
|
)
|
||||||
|
(trace:info `(loop ,cgen-lis))
|
||||||
(c-code
|
(c-code
|
||||||
(string-append
|
(string-append
|
||||||
;(c:allocs->str (c:allocs cgen))
|
cgen-allocs ;(c:allocs->str (c:allocs cgen))
|
||||||
"\n"
|
"\n"
|
||||||
(c:body cgen) ;; TODO: re-assign function args, longer-term using temp variables
|
;; TODO: (c:body cgen) ;; TODO: re-assign function args, longer-term using temp variables
|
||||||
"\n"
|
"\n"
|
||||||
"goto loop;")))
|
"goto loop;")))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue