mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
more alpha-rename robustness
* module/language/tree-il/optimize.scm (alpha-rename): Handle all kinds of tree-il, with the current exceptions of lexical set!, prompt, and abort.
This commit is contained in:
parent
5d5e4f399a
commit
ddbee5c00f
1 changed files with 27 additions and 0 deletions
|
@ -92,6 +92,15 @@ references to the new symbols."
|
|||
(vals (map (cut loop <> mapping) vals))
|
||||
(body (loop body mapping)))
|
||||
(make-letrec src in-order? names new vals body)))
|
||||
(($ <fix> src names gensyms vals body)
|
||||
;; Likewise.
|
||||
(let* ((new (fresh-gensyms names))
|
||||
(mapping (fold vhash-consq mapping gensyms new))
|
||||
(vals (map (cut loop <> mapping) vals))
|
||||
(body (loop body mapping)))
|
||||
(make-fix src names new vals body)))
|
||||
(($ <let-values> src exp body)
|
||||
(make-let-values src (loop exp mapping) (loop body mapping)))
|
||||
(($ <const>)
|
||||
exp)
|
||||
(($ <void>)
|
||||
|
@ -102,6 +111,24 @@ references to the new symbols."
|
|||
exp)
|
||||
(($ <primitive-ref>)
|
||||
exp)
|
||||
(($ <toplevel-set> src name exp)
|
||||
(make-toplevel-set src name (loop exp mapping)))
|
||||
(($ <toplevel-define> src name exp)
|
||||
(make-toplevel-define src name (loop exp mapping)))
|
||||
(($ <module-set> src mod name public? exp)
|
||||
(make-module-set src mod name public? (loop exp mapping)))
|
||||
(($ <dynlet> src fluids vals body)
|
||||
(make-dynlet src
|
||||
(map (cut loop <> mapping) fluids)
|
||||
(map (cut loop <> mapping) vals)
|
||||
(loop body mapping)))
|
||||
(($ <dynwind> src winder body unwinder)
|
||||
(make-dynwind src
|
||||
(loop winder mapping)
|
||||
(loop body mapping)
|
||||
(loop unwinder mapping)))
|
||||
(($ <dynref> src fluid)
|
||||
(make-dynref src (loop fluid mapping)))
|
||||
(($ <conditional> src condition subsequent alternate)
|
||||
(make-conditional src
|
||||
(loop condition mapping)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue