mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 16:27:35 +02:00
WIP
This commit is contained in:
parent
49c2c093fd
commit
b2a981b7e5
1 changed files with 14 additions and 3 deletions
|
@ -649,9 +649,20 @@
|
||||||
(and (> len 0)
|
(and (> len 0)
|
||||||
(equal? end (substring str (- len 1) len)))))
|
(equal? end (substring str (- len 1) len)))))
|
||||||
|
|
||||||
|
TODO: move this into prim module, integrate with existing function somehow
|
||||||
|
;;(define (prim->c-func* p use-alloca?)
|
||||||
|
;; (cond
|
||||||
|
;; (else
|
||||||
|
;; (prim->c-func p))))
|
||||||
|
TODO: add use-alloca? param to prim:allocates-object? and modify per above
|
||||||
|
|
||||||
;; c-compile-prim : prim-exp -> string -> string
|
;; c-compile-prim : prim-exp -> string -> string
|
||||||
(define (c-compile-prim p cont)
|
(define (c-compile-prim p cont ast-id)
|
||||||
(let* ((c-func
|
(let* ((ast-fnc (adb:get/default ast-id #f))
|
||||||
|
;; Use alloca for stack allocations?
|
||||||
|
(use-alloca? (and ast-fnc
|
||||||
|
(adbf:calls-self? ast-fnc)))
|
||||||
|
(c-func
|
||||||
(if (prim:udf? p)
|
(if (prim:udf? p)
|
||||||
(string-append
|
(string-append
|
||||||
"((inline_function_type)
|
"((inline_function_type)
|
||||||
|
@ -874,7 +885,7 @@
|
||||||
|
|
||||||
((prim? fun)
|
((prim? fun)
|
||||||
(let* ((c-fun
|
(let* ((c-fun
|
||||||
(c-compile-prim fun cont))
|
(c-compile-prim fun cont ast-id))
|
||||||
(c-args
|
(c-args
|
||||||
(c-compile-args args append-preamble "" "" ast-id trace cps?))
|
(c-compile-args args append-preamble "" "" ast-id trace cps?))
|
||||||
(num-args (length args))
|
(num-args (length args))
|
||||||
|
|
Loading…
Add table
Reference in a new issue