mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-20 22:29:16 +02:00
Added calls-self to adbf
This commit is contained in:
parent
5f760e4a2c
commit
b37cbc3106
1 changed files with 8 additions and 0 deletions
|
@ -87,6 +87,7 @@
|
||||||
adbf:well-known adbf:set-well-known!
|
adbf:well-known adbf:set-well-known!
|
||||||
adbf:cgen-id adbf:set-cgen-id!
|
adbf:cgen-id adbf:set-cgen-id!
|
||||||
adbf:closure-size adbf:set-closure-size!
|
adbf:closure-size adbf:set-closure-size!
|
||||||
|
adbf:calls-self? adbf:set-calls-self!
|
||||||
with-fnc
|
with-fnc
|
||||||
with-fnc!
|
with-fnc!
|
||||||
)
|
)
|
||||||
|
@ -224,6 +225,8 @@
|
||||||
side-effects
|
side-effects
|
||||||
well-known
|
well-known
|
||||||
cgen-id
|
cgen-id
|
||||||
|
closure-size
|
||||||
|
calls-self
|
||||||
)
|
)
|
||||||
adb:function?
|
adb:function?
|
||||||
(simple adbf:simple adbf:set-simple!)
|
(simple adbf:simple adbf:set-simple!)
|
||||||
|
@ -241,6 +244,8 @@
|
||||||
(cgen-id adbf:cgen-id adbf:set-cgen-id!)
|
(cgen-id adbf:cgen-id adbf:set-cgen-id!)
|
||||||
;; Number of elements in the function's closure
|
;; Number of elements in the function's closure
|
||||||
(closure-size adbf:closure-size adbf:set-closure-size!)
|
(closure-size adbf:closure-size adbf:set-closure-size!)
|
||||||
|
;; Does this function call itself?
|
||||||
|
(calls-self adbf:calls-self? adbf:set-calls-self!)
|
||||||
)
|
)
|
||||||
(define (adb:make-fnc)
|
(define (adb:make-fnc)
|
||||||
(%adb:make-fnc
|
(%adb:make-fnc
|
||||||
|
@ -252,6 +257,7 @@
|
||||||
#f ;; well-known
|
#f ;; well-known
|
||||||
#f ;; cgen-id
|
#f ;; cgen-id
|
||||||
-1 ;; closure-size
|
-1 ;; closure-size
|
||||||
|
#f ;; calls-self
|
||||||
))
|
))
|
||||||
|
|
||||||
;; A constant value that cannot be mutated
|
;; A constant value that cannot be mutated
|
||||||
|
@ -2058,6 +2064,8 @@
|
||||||
(when (or ;(equal? (car exp) def-sym) TODO: def-sym is obsolete, remove it
|
(when (or ;(equal? (car exp) def-sym) TODO: def-sym is obsolete, remove it
|
||||||
(rec-call? (car exp) lid))
|
(rec-call? (car exp) lid))
|
||||||
;(trace:info `("recursive call" ,exp))
|
;(trace:info `("recursive call" ,exp))
|
||||||
|
(with-fnc! lid (lambda (fnc)
|
||||||
|
(adbf:set-calls-self! fnc #t)))
|
||||||
(with-var! (car exp) (lambda (var)
|
(with-var! (car exp) (lambda (var)
|
||||||
(adbv:set-self-rec-call! var #t))))
|
(adbv:set-self-rec-call! var #t))))
|
||||||
(for-each
|
(for-each
|
||||||
|
|
Loading…
Add table
Reference in a new issue