From 6a37b7faaf150e9fb7945ef79969cb7671d17367 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 27 Oct 2013 20:10:59 +0100 Subject: [PATCH] Compile-time debugging * module/language/cps/compile-rtl.scm: * module/language/cps/contification.scm: Add some compile-time printouts. Will be removed later. --- module/language/cps/compile-rtl.scm | 6 +++++- module/language/cps/contification.scm | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/language/cps/compile-rtl.scm b/module/language/cps/compile-rtl.scm index 6284eb089..6a136946b 100644 --- a/module/language/cps/compile-rtl.scm +++ b/module/language/cps/compile-rtl.scm @@ -50,7 +50,9 @@ (define (optimize exp opts) (define (run-pass exp pass kw default) (if (kw-arg-ref opts kw default) - (pass exp) + (begin + (pk 'OPTIMIZING kw) + (pass exp)) exp)) ;; Calls to source-to-source optimization passes go here. @@ -433,11 +435,13 @@ (emit-end-program asm))))) (define (compile-rtl exp env opts) + (pk 'COMPILING) (let* ((exp (fix-arities exp)) (exp (optimize exp opts)) (exp (convert-closures exp)) (exp (reify-primitives exp)) (asm (make-assembler))) + (pk 'CODEGEN) (visit-funs (lambda (fun) (compile-fun fun asm)) exp) diff --git a/module/language/cps/contification.scm b/module/language/cps/contification.scm index 00a5a5767..970432adf 100644 --- a/module/language/cps/contification.scm +++ b/module/language/cps/contification.scm @@ -345,5 +345,7 @@ (if (null? call-substs) fun ;; Iterate to fixed point. - (contify - (apply-contification fun call-substs cont-substs fun-elisions cont-splices)))))) + (begin + (pk 'CONTIFIED (length call-substs)) + (contify + (apply-contification fun call-substs cont-substs fun-elisions cont-splices)))))))