mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Staging initial cgen changes
This commit is contained in:
parent
927856ec55
commit
d4e3c65ca7
1 changed files with 25 additions and 10 deletions
|
@ -912,16 +912,31 @@
|
||||||
");")))
|
");")))
|
||||||
(else ;; CPS, IE normal behavior
|
(else ;; CPS, IE normal behavior
|
||||||
(set-c-call-arity! num-cargs)
|
(set-c-call-arity! num-cargs)
|
||||||
(c-code
|
(with-fnc (ast:lambda-id (closure->lam fun)) (lambda (fnc)
|
||||||
(string-append
|
(if (and #f (adbf:well-known fnc))
|
||||||
(c:allocs->str (c:allocs cfun) "\n")
|
#f
|
||||||
(c:allocs->str (c:allocs cargs) "\n")
|
;;(c-code
|
||||||
"return_closcall" (number->string num-cargs)
|
;; (string-append
|
||||||
"(data,"
|
;; (c:allocs->str (c:allocs cfun) "\n")
|
||||||
this-cont
|
;; (c:allocs->str (c:allocs cargs) "\n")
|
||||||
(if (> num-cargs 0) "," "")
|
;; "return_direct_with_clo" (number->string num-cargs)
|
||||||
(c:body cargs)
|
;; "(data,"
|
||||||
");"))))))
|
;; this-cont
|
||||||
|
;; ","
|
||||||
|
;; // TODO: fnc name, twice
|
||||||
|
;; (if (> num-cargs 0) "," "")
|
||||||
|
;; (c:body cargs)
|
||||||
|
;; ");"))
|
||||||
|
(c-code
|
||||||
|
(string-append
|
||||||
|
(c:allocs->str (c:allocs cfun) "\n")
|
||||||
|
(c:allocs->str (c:allocs cargs) "\n")
|
||||||
|
"return_closcall" (number->string num-cargs)
|
||||||
|
"(data,"
|
||||||
|
this-cont
|
||||||
|
(if (> num-cargs 0) "," "")
|
||||||
|
(c:body cargs)
|
||||||
|
");")))))))))
|
||||||
|
|
||||||
((equal? 'Cyc-seq fun)
|
((equal? 'Cyc-seq fun)
|
||||||
(let ((exps (foldr
|
(let ((exps (foldr
|
||||||
|
|
Loading…
Add table
Reference in a new issue