mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Determine if vars are defined within a loop
This commit is contained in:
parent
e4e6f23f0e
commit
3cf0e0a0c7
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
;; TODO:
|
||||
;; - identify refs within named lets
|
||||
;; and also, whether refs are defined (or not) in loop
|
||||
;; - will probably need to hook into analysis DB in production version
|
||||
;; - will this find function work for optimized CPS? should test that, too
|
||||
;; - does find need to be more robust? Are there false positives?
|
||||
|
@ -24,7 +25,18 @@
|
|||
"lambda-"
|
||||
(number->string id)
|
||||
(if has-cont "-cont" ""))))
|
||||
(args* (ast:lambda-args exp))
|
||||
(args (if (null? args*)
|
||||
'()
|
||||
(formals->list args*)))
|
||||
)
|
||||
(when lp
|
||||
(for-each
|
||||
(lambda (a)
|
||||
(write `(,a defined in a loop))
|
||||
(newline))
|
||||
args)
|
||||
)
|
||||
`(,sym ,(ast:lambda-args exp)
|
||||
,@(map (lambda (e) (scan e lp)) (ast:lambda-body exp))))
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue