mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
Keep track of which refs are continuations
This commit is contained in:
parent
3bd5d52671
commit
72c1bb9bea
1 changed files with 9 additions and 2 deletions
|
@ -70,7 +70,8 @@
|
|||
const const-value ref-by
|
||||
reassigned assigned-value
|
||||
app-fnc-count app-arg-count
|
||||
inlinable mutated-indirectly)
|
||||
inlinable mutated-indirectly
|
||||
cont)
|
||||
adb:variable?
|
||||
(global adbv:global? adbv:set-global!)
|
||||
(defined-by adbv:defined-by adbv:set-defined-by!)
|
||||
|
@ -91,6 +92,7 @@
|
|||
(inlinable adbv:inlinable adbv:set-inlinable!)
|
||||
;; Is the variable mutated indirectly? (EG: set-car! of a cdr)
|
||||
(mutated-indirectly adbv:mutated-indirectly? adbv:set-mutated-indirectly!)
|
||||
(cont adbv:cont? adbv:set-cont!)
|
||||
)
|
||||
|
||||
(define (adbv-set-assigned-value-helper! sym var value)
|
||||
|
@ -119,7 +121,7 @@
|
|||
)
|
||||
|
||||
(define (adb:make-var)
|
||||
(%adb:make-var '? '? #f #f #f '() #f #f 0 0 #t #f))
|
||||
(%adb:make-var '? '? #f #f #f '() #f #f 0 0 #t #f #f))
|
||||
|
||||
(define-record-type <analysis-db-function>
|
||||
(%adb:make-fnc simple unused-params assigned-to-var side-effects)
|
||||
|
@ -268,6 +270,11 @@
|
|||
(let* ((id (ast:lambda-id exp))
|
||||
(fnc (adb:get/default id (adb:make-fnc))))
|
||||
(adb:set! id fnc)
|
||||
;; Flag continuation variable, if present
|
||||
(if (ast:lambda-has-cont exp)
|
||||
(let ((k (car (ast:lambda-args exp))))
|
||||
(with-var! k (lambda (var)
|
||||
(adbv:set-cont! var #t)))))
|
||||
(for-each
|
||||
(lambda (expr)
|
||||
(analyze-find-lambdas expr id))
|
||||
|
|
Loading…
Add table
Reference in a new issue