1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

Always resolve-primitives in the root module.

* module/language/tree-il/primitives.scm (resolve-primitives): If we are
  compiling in the root module, ignore local definitions.
This commit is contained in:
Andy Wingo 2013-10-23 16:57:14 +02:00
parent 8cff7f54dc
commit 33e9a90d7b

View file

@ -255,14 +255,17 @@
(define local-definitions
(make-hash-table))
(let collect-local-definitions ((x x))
(record-case x
((<toplevel-define> name)
(hashq-set! local-definitions name #t))
((<seq> head tail)
(collect-local-definitions head)
(collect-local-definitions tail))
(else #f)))
;; Assume that any definitions with primitive names in the root module
;; have the same semantics as the primitives.
(unless (eq? mod the-root-module)
(let collect-local-definitions ((x x))
(record-case x
((<toplevel-define> name)
(hashq-set! local-definitions name #t))
((<seq> head tail)
(collect-local-definitions head)
(collect-local-definitions tail))
(else #f))))
(post-order
(lambda (x)