mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 01:07:34 +02:00
Experimental change to only emit assignments for used args
Having other compilation issues but want to get this checked in since we need this functionality
This commit is contained in:
parent
1e91243b16
commit
b6c5a9007a
1 changed files with 16 additions and 7 deletions
|
@ -1824,6 +1824,7 @@
|
|||
(cps?
|
||||
(let ((i 0)
|
||||
(cstr "")
|
||||
;;;(scm-args (ast:lambda-formals->list exp))
|
||||
(args formals-as-list))
|
||||
;; Strip off extra varargs since we will load them
|
||||
;; up using a different technique
|
||||
|
@ -1834,14 +1835,22 @@
|
|||
;; Generate code to unpack args into locals w/expected names
|
||||
(for-each
|
||||
(lambda (arg)
|
||||
(set! cstr (string-append
|
||||
cstr
|
||||
arg
|
||||
" = args["
|
||||
(number->string i)
|
||||
"];"
|
||||
))
|
||||
;;;(lambda (scm-arg arg)
|
||||
;;;(trace:error `(DEBUG ,scm-arg ARG ,arg))
|
||||
;;;(let ((var (adb:get scm-arg)))
|
||||
;;; (when (and (> (adbv:ref-count var) 0)
|
||||
;;; (not (null? (adbv:ref-by var))))
|
||||
(set! cstr (string-append
|
||||
cstr
|
||||
arg
|
||||
" = args["
|
||||
(number->string i)
|
||||
"];"
|
||||
) ;))
|
||||
(set! i (+ i 1)))
|
||||
;;;(if has-closure?
|
||||
;;; (cdr scm-args)
|
||||
;;; scm-args))
|
||||
(if has-closure?
|
||||
(cdr args)
|
||||
args))
|
||||
|
|
Loading…
Add table
Reference in a new issue