1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

tree-il: Pass the environment to warning passes.

* module/language/tree-il/analyze.scm (report-unused-variables): Taken a
  new parameter, ENV.

* module/language/tree-il/compile-glil.scm (compile-glil): Pass E to
  individual warning passes.
This commit is contained in:
Ludovic Courtès 2009-10-06 23:36:53 +02:00
parent b25aa0b937
commit 43eb8acada
2 changed files with 3 additions and 3 deletions

View file

@ -502,7 +502,7 @@
(refs binding-info-refs) ;; (GENSYM ...) (refs binding-info-refs) ;; (GENSYM ...)
(locs binding-info-locs)) ;; (LOCATION ...) (locs binding-info-locs)) ;; (LOCATION ...)
(define (report-unused-variables tree) (define (report-unused-variables tree env)
"Report about unused variables in TREE. Return TREE." "Report about unused variables in TREE. Return TREE."
(define (dotless-list lst) (define (dotless-list lst)

View file

@ -53,11 +53,11 @@
(or (and=> (memq #:warnings opts) cadr) (or (and=> (memq #:warnings opts) cadr)
'())) '()))
;; Go throught the warning passes. ;; Go through the warning passes.
(for-each (lambda (kind) (for-each (lambda (kind)
(let ((warn (assoc-ref %warning-passes kind))) (let ((warn (assoc-ref %warning-passes kind)))
(and (procedure? warn) (and (procedure? warn)
(warn x)))) (warn x e))))
warnings) warnings)
(let* ((x (make-lambda (tree-il-src x) '() '() '() x)) (let* ((x (make-lambda (tree-il-src x) '() '() '() x))