mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Omit assignments to unused local vars
This commit is contained in:
parent
27484cd4a4
commit
2ddabc9494
1 changed files with 11 additions and 11 deletions
|
@ -1824,7 +1824,7 @@
|
|||
(cps?
|
||||
(let ((i 0)
|
||||
(cstr "")
|
||||
;;;(scm-args (ast:lambda-formals->list exp))
|
||||
(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,23 +1834,23 @@
|
|||
(cddr (reverse args)))))
|
||||
;; Generate code to unpack args into locals w/expected names
|
||||
(for-each
|
||||
(lambda (arg)
|
||||
;;;(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))))
|
||||
(lambda (scm-arg arg)
|
||||
(trace:error `(DEBUG ,scm-arg ARG ,arg))
|
||||
(let ((var (adb:get/default scm-arg #f)))
|
||||
(when (and var
|
||||
(> (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 scm-args)
|
||||
scm-args)
|
||||
(if has-closure?
|
||||
(cdr args)
|
||||
args))
|
||||
|
|
Loading…
Add table
Reference in a new issue