mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 08:40:19 +02:00
add lexical analyzer and allocator
* module/language/tree-il/optimize.scm: Rework to just export the optimize! procedure. * module/language/tree-il/compile-glil.scm (analyze-lexicals): New function, analyzes and allocates lexical variables. Almost ready to compile now. (codegen): Dedent.
This commit is contained in:
parent
cb28c08537
commit
073bb617eb
2 changed files with 415 additions and 221 deletions
|
@ -22,7 +22,14 @@
|
|||
(define-module (language tree-il optimize)
|
||||
#:use-module (system base syntax)
|
||||
#:use-module (language tree-il)
|
||||
#:export (resolve-primitives!))
|
||||
#:use-module (language tree-il inline)
|
||||
#:export (optimize!))
|
||||
|
||||
(define (env-module e)
|
||||
(if e (car e) (current-module)))
|
||||
|
||||
(define (optimize! x env opts)
|
||||
(expand-primitives! (resolve-primitives! x (env-module env))))
|
||||
|
||||
;; Possible optimizations:
|
||||
;; * constant folding, propagation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue