Move a few things around to accomodate the C back end.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 24 Oct 1992 16:01:10 +0000 (16:01 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 24 Oct 1992 16:01:10 +0000 (16:01 +0000)
v7/src/compiler/back/lapgn1.scm
v7/src/compiler/back/lapgn3.scm
v7/src/compiler/base/asstop.scm
v7/src/compiler/base/toplev.scm

index 00bb99008dd7bf48982c528ceeed3437e9e700fe..f291f32e3eaff0a4dc6aacf0e6ad0f5f2c7557cd 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/back/lapgn1.scm,v 4.12 1991/10/22 09:53:38 cph Exp $
+$Id: lapgn1.scm,v 4.13 1992/10/24 16:01:03 jinx Exp $
 
-Copyright (c) 1987-91 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -54,14 +54,7 @@ MIT in each case. |#
                                 (constant->label (vector-ref remote-link 0)))
                    unspecific)
                  remote-links)
-       (with-values
-           (lambda ()
-             (generate/constants-block *interned-constants*
-                                       *interned-variables*
-                                       *interned-assignments*
-                                       *interned-uuo-links*
-                                       *interned-global-links*
-                                       *interned-static-variables*))
+       (with-values prepare-constants-block
          (or process-constants-block
              (lambda (constants-code environment-label free-ref-label
                                      n-sections)
index 13e4f9712602eb73898eb611a667303935decde5..ba1cd0a0cc896dd59d191ccfe4d4ab6e3b0f6bb3 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: lapgn3.scm,v 4.10 1992/10/19 19:14:11 jinx Exp $
+$Id: lapgn3.scm,v 4.11 1992/10/24 16:01:10 jinx Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -151,4 +151,12 @@ MIT in each case. |#
   (uuo-link-label (lambda () *interned-global-links*)
                  (lambda (new)
                    (set! *interned-global-links* new))
-                 "GLOBAL-"))
\ No newline at end of file
+                 "GLOBAL-"))
+
+(define (prepare-constants-block)
+  (generate/constants-block *interned-constants*
+                           *interned-variables*
+                           *interned-assignments*
+                           *interned-uuo-links*
+                           *interned-global-links*
+                           *interned-static-variables*))
\ No newline at end of file
index ddce6473ce0be5f8050b8ee61aa69c627d43e956..ce759cdeead1e4beb908f0a5d369f0cbdb0d14bc 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: asstop.scm,v 1.1 1992/10/19 19:11:52 jinx Exp $
+$Id: asstop.scm,v 1.2 1992/10/24 16:00:56 jinx Exp $
 
 Copyright (c) 1988-1992 Massachusetts Institute of Technology
 
@@ -45,7 +45,9 @@ MIT in each case. |#
 (define (compiled-scode->procedure scode environment)
   (scode-eval scode environment))
 
-;;; State variables for the assembler and linker
+;;; Global variables for the assembler and linker
+
+(define *recursive-compilation-results*)
 
 ;; First set: phase/rtl-generation
 ;; Last used: phase/link
@@ -78,6 +80,10 @@ MIT in each case. |#
             (lap:make-entry-point entry-label *block-label*))
        ,@some-lap))
 \f
+(define (bind-assembler&linker-top-level-variables thunk)
+  (fluid-let ((*recursive-compilation-results* '()))
+    (thunk)))
+
 (define (bind-assembler&linker-variables thunk)
   (fluid-let ((*block-label*)
              (*external-labels*)
@@ -96,6 +102,7 @@ MIT in each case. |#
     (thunk)))
 
 (define (assembler&linker-reset!)
+  (set! *recursive-compilation-results* '())
   (set! *block-label*)
   (set! *external-labels*)
   (set! *end-of-block-code*)
index 6cea94baaeab4b1903a1b7921e82bd74426925ec..62d89fae7fec091651965cf38dc364cf60a7eaf8 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: toplev.scm,v 4.46 1992/10/19 19:13:30 jinx Exp $
+$Id: toplev.scm,v 4.47 1992/10/24 16:00:50 jinx Exp $
 
 Copyright (c) 1988-1992 Massachusetts Institute of Technology
 
@@ -256,7 +256,6 @@ MIT in each case. |#
 
 (define *recursive-compilation-count*)
 (define *recursive-compilation-number*)
-(define *recursive-compilation-results*)
 (define *procedure-result?*)
 (define *remote-links*)
 (define *process-time*)
@@ -351,12 +350,13 @@ MIT in each case. |#
          (run-compiler))
        (fluid-let ((*recursive-compilation-number* 0)
                    (*recursive-compilation-count* 1)
-                   (*recursive-compilation-results* '())
                    (*procedure-result?* false)
                    (*remote-links* '())
                    (*process-time* 0)
                    (*real-time* 0))
-         (bind-compiler-variables run-compiler)))))
+         (bind-assembler&linker-top-level-variables
+          (lambda ()
+            (bind-compiler-variables run-compiler)))))))
 \f
 (define (bind-compiler-variables thunk)
   ;; Split this fluid-let because compiler was choking on it.
@@ -392,7 +392,6 @@ MIT in each case. |#
 (define (compiler:reset!)
   (set! *recursive-compilation-number* 0)
   (set! *recursive-compilation-count* 1)
-  (set! *recursive-compilation-results* '())
   (set! *procedure-result?* false)
   (set! *remote-links* '())
   (set! *process-time* 0)