1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 12:20:20 +02:00

Add with-fresh-name-state-from-dfg

* module/language/cps/dfg.scm (with-fresh-name-state-from-dfg): New
  helper.
  ($dfg, compute-dfg): Store max-var and max-label in the dfg.

* module/language/cps.scm (with-fresh-name-state): Don't raise an error
  on recursive invocation; that was mostly useful when finding a bug.

* module/language/cps/arities.scm (fix-arities):
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
  Use the new helper.

* .dir-locals.el: Update.
This commit is contained in:
Andy Wingo 2014-04-02 16:25:07 +02:00
parent af11242268
commit 3e1b97c1b0
5 changed files with 25 additions and 15 deletions

View file

@ -215,15 +215,12 @@
body ...))
(define-syntax-rule (with-fresh-name-state fun body ...)
(begin
(when (or (label-counter) (var-counter))
(error "with-fresh-name-state should not be called recursively"))
(call-with-values (lambda ()
(compute-max-label-and-var fun))
(lambda (max-label max-var)
(parameterize ((label-counter (1+ max-label))
(var-counter (1+ max-var)))
body ...)))))
(call-with-values (lambda ()
(compute-max-label-and-var fun))
(lambda (max-label max-var)
(parameterize ((label-counter (1+ max-label))
(var-counter (1+ max-var)))
body ...))))
(define-syntax build-arity
(syntax-rules (unquote)