Compile-time debugging
authorAndy Wingo <wingo@pobox.com>
Sun, 27 Oct 2013 19:10:59 +0000 (20:10 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 31 Oct 2013 11:55:17 +0000 (12:55 +0100)
* 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
module/language/cps/contification.scm

index 6284eb0..6a13694 100644 (file)
@@ -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.
        (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)
index 00a5a57..970432a 100644 (file)
       (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)))))))