>From de188037d5535e338dabd3afec89d8be7014b3c6 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 10 Aug 2014 15:17:03 +0200 Subject: [PATCH 03/19] compiler-modules: Convert lfa2 to a module Add a few missing names to compiler-namespace which would otherwise be undefined within lfa2. --- batch-driver.scm | 6 ++++-- compiler-namespace.scm | 7 ++++++- lfa2.scm | 13 ++++++++++--- rules.make | 5 +++-- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/batch-driver.scm b/batch-driver.scm index 015ef8e..7b263b4 100644 --- a/batch-driver.scm +++ b/batch-driver.scm @@ -29,7 +29,8 @@ ;; Same goes for "backend" and "platform". (declare (unit batch-driver) - (uses extras data-structures files srfi-1) ) + (uses extras data-structures files srfi-1 + lfa2) ) ;; TODO: Remove these once everything's converted to modules (include "private-namespace") @@ -42,7 +43,8 @@ user-post-analysis-pass) (import (except chicken put! get quit syntax-error) scheme - extras data-structures files srfi-1) + extras data-structures files srfi-1 + lfa2) (include "tweaks") diff --git a/compiler-namespace.scm b/compiler-namespace.scm index f39ee3e..4a66a49 100644 --- a/compiler-namespace.scm +++ b/compiler-namespace.scm @@ -211,10 +211,16 @@ no-global-procedure-checks enable-module-registration no-procedure-checks + node-class + node-class-set! + node-parameters + node-parameters-set! node->sexpr node-subexpressions + node-subexpressions-set! non-foldable-bindings nonwinding-call/cc + number-type optimization-iterations optimize-leaf-routines original-program-size @@ -227,7 +233,6 @@ perform-high-level-optimizations perform-inlining! perform-pre-optimization! - perform-secondary-flow-analysis posv posq postponed-initforms diff --git a/lfa2.scm b/lfa2.scm index be49afa..4c85686 100644 --- a/lfa2.scm +++ b/lfa2.scm @@ -34,12 +34,18 @@ (declare (unit lfa2) - (hide d-depth lfa2-debug d dd +type-check-map+ +predicate-map+)) - + (uses srfi-1) ) +;; TODO: Remove these once everything's converted to modules +(include "private-namespace") (include "compiler-namespace") -(include "tweaks") +(module lfa2 + (perform-secondary-flow-analysis) + +(import (except chicken put! get quit syntax-error) scheme srfi-1) + +(include "tweaks") (define d-depth 0) (define lfa2-debug #t) @@ -359,3 +365,4 @@ (for-each (lambda (ss) (printf " ~a:\t~a~%" (car ss) (cdr ss))) stats)))))) +) diff --git a/rules.make b/rules.make index ee3c74e..e29669b 100644 --- a/rules.make +++ b/rules.make @@ -492,10 +492,11 @@ endef $(foreach lib, $(SETUP_API_OBJECTS_1),\ $(eval $(call declare-emitted-import-lib-dependency,$(lib)))) -$(foreach lib, $(filter batch-driver,$(COMPILER_OBJECTS_1)),\ +$(foreach lib, batch-driver lfa2,\ $(eval $(call declare-emitted-import-lib-dependency,$(lib)))) -chicken.scm: batch-driver.import.scm batch-driver.scm +chicken.c: chicken.scm batch-driver.import.scm batch-driver.scm +batch-driver.c: batch-driver.scm lfa2.import.scm lfa2.scm define profile-flags $(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile) -- 1.7.10.4