mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-15 01:10:53 -07:00
Add functions referenced by children to their parent.
This commit is contained in:
parent
26aeb1c1c2
commit
f316c42396
2 changed files with 10 additions and 3 deletions
|
|
@ -89,8 +89,7 @@
|
|||
body-c1form)))
|
||||
|
||||
(defun child-function-p (presumed-parent fun)
|
||||
(declare (si::c-local)
|
||||
(optimize speed))
|
||||
(declare (optimize speed))
|
||||
(loop for real-parent = (fun-parent fun)
|
||||
while real-parent
|
||||
do (if (eq real-parent presumed-parent)
|
||||
|
|
|
|||
|
|
@ -131,7 +131,15 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts."
|
|||
(reduce #'add-referred-variables-to-function
|
||||
(mapcar #'fun-referenced-vars (fun-referenced-funs fun))
|
||||
:initial-value fun)
|
||||
(update-fun-closure-type-many (fun-child-funs fun))
|
||||
;; Add all non-global functions which are referenced by children
|
||||
;; excluding those created inside this function.
|
||||
(loop with children = (fun-child-funs fun)
|
||||
for child in children
|
||||
do (loop for f in (fun-referenced-funs child)
|
||||
unless (or (fun-global f)
|
||||
(child-function-p fun f))
|
||||
do (pushnew f (fun-referenced-funs fun)))
|
||||
finally (update-fun-closure-type-many children))
|
||||
(update-fun-closure-type fun)
|
||||
(when global
|
||||
(if (fun-closure fun)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue