#| -*-Scheme-*-
-$Id: toplev.scm,v 1.10 1995/08/08 15:59:50 adams Exp $
+$Id: toplev.scm,v 1.11 1995/08/08 16:20:33 adams Exp $
Copyright (c) 1988-1995 Massachusetts Institute of Technology
(newline)
(write-string "Final KMP program ")
(write *recursive-compilation-number*)
- (if *kmp-output-abbreviated?*
+ (if compiler:kmp-output-abbreviated?
(begin
- (write-string " (*kmp-output-abbreviated?* is #T)")
+ (write-string " (compiler:kmp-output-abbreviated? is #T)")
(newline)
(kmp/ppp *optimized-kmp-program*))
(fluid-let (;; (*pp-uninterned-symbols-by-name* false)
(define *remote-links*)
(define *kmp-output-port* false)
-(define *kmp-output-abbreviated?* true)
(define *info-output-filename* false)
(define *rtl-output-port* false)
(thunk))))
(define *output-prefix* "")
-(define *phase-level* 0)
(define (compiler-phase/invisible thunk)
- (fluid-let ((*phase-level* (1+ *phase-level*)))
- (let ((do-it
- (if compiler:phase-wrapper
- (lambda () (compiler:phase-wrapper thunk))
- thunk)))
- (do-it))))
+ (if compiler:phase-wrapper
+ (lambda () (compiler:phase-wrapper thunk))
+ (thunk)))
(define ((compiler-time-reporter prefix) process-non-gc process-gc real)
#| -*-Scheme-*-
-$Id: midend.scm,v 1.15 1995/08/07 16:17:35 adams Exp $
+$Id: midend.scm,v 1.16 1995/08/08 16:20:41 adams Exp $
Copyright (c) 1994 Massachusetts Institute of Technology
(define *phases-to-show* '())
(define *phases-to-omit* '())
-(define *announce-phases?* false)
(define *debugging?* true)
(define *current-phase-input* false)
(define *entry-label*)
(set! pending-message #F)
(show-message message)
(write-string " #@") (display (hash program))
- (if *kmp-output-abbreviated?*
+ (if compiler:kmp-output-abbreviated?
(begin
- (write-string " (*kmp-output-abbreviated?* is #T)")
+ (write-string " (compiler:kmp-output-abbreviated? is #T)")
(newline)
(kmp/ppp program))
(begin
(set! *current-phase* this-phase)
(set! *current-phase-input* (and *debugging?* program))
(phase/pre-hook program)
- (if *announce-phases?*
+ (if (and (or compiler:show-subphases? compiler:guru?)
+ (memq this-phase *phases-to-omit*))
(begin
(newline)
- (write-string " Phase ")
+ (write-string *output-prefix*)
+ (write-string " Omitting ")
(write this-phase)
- (if (memq this-phase *phases-to-omit*)
- (write-string " omitted (see *phases-to-omit*)"))))
+ (write-string " (see *phases-to-omit*)")))
(let ((result
(if (not (show? this-phase))
(run-phase program)
;;(gather-phase-statistics program result)
result)))))
-(define (phase-wrapper rewrite)
+(define (phase-wrapper name rewrite)
(lambda (program)
(let ((table *code-rewrite-table*))
(set! *previous-code-rewrite-table* table)
(set! *code-rewrite-table* (and table (code/rewrite-table/make)))
- (rewrite program))))
+ (compiler-subphase
+ (with-output-to-string (lambda () (write name)))
+ (lambda () (rewrite program))))))
(define (dummy-phase rewrite)
(lambda (program)
`(lambda (,name)
,result)
(loop `((debugging-phase-wrapper
- (phase-wrapper ,(car all))
+ (phase-wrapper ',(car all) ,(car all))
',(car all)
',(if (null? (cdr all))
false
assconv/top-level ; eliminate SET! and introduce LETREC
; rewriting LOOKUP and SET!
cleanup/top-level/1 ; as below
- ;;coerce/top-level
+ coerce/top-level
earlyrew/top-level ; rewrite -1+ into -, etc.