From 69af89422488c4629f13531b2c8e689e6abcea28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 16 Dec 2019 10:14:57 +0100 Subject: [PATCH] cmp: remove dynamic variable *compiler-input* *compiler-input* was only passed to the first-pass, there is no need for a dynamic binding. --- src/cmp/cmpglobals.lsp | 1 - src/cmp/cmpmain.lsp | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cmp/cmpglobals.lsp b/src/cmp/cmpglobals.lsp index 7159b6a52..abec2466d 100644 --- a/src/cmp/cmpglobals.lsp +++ b/src/cmp/cmpglobals.lsp @@ -69,7 +69,6 @@ running the compiler. It may be updated by running ") (defvar *compiler-break-enable* nil) (defvar *compiler-in-use* nil) -(defvar *compiler-input*) (defvar *compiler-output1*) (defvar *compiler-output2*) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index a374fd2cf..954690682 100755 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -666,11 +666,11 @@ compiled successfully, returns the pathname of the compiled file" (when (probe-file "./cmpinit.lsp") (load "./cmpinit.lsp" :verbose *compile-verbose*)) - (with-open-file (*compiler-input* *compile-file-pathname* - :external-format external-format) + (with-open-file (stream *compile-file-pathname* + :external-format external-format) (unless source-truename (setf (car ext:*source-location*) *compile-file-pathname*)) - (compiler-pass1 *compiler-input* source-offset)) + (compiler-pass1 stream source-offset)) (cmpprogress "~&;;; End of Pass 1.") (setf init-name (compute-init-name output-file :kind @@ -904,9 +904,9 @@ from the C language code. NIL means \"do not create the file\"." (data-init) (if (streamp object) (do* ((eof '(NIL)) - (*compile-file-position* 0 (file-position *compiler-input*)) - (form (si::read-object-or-ignore *compiler-input* eof) - (si::read-object-or-ignore *compiler-input* eof))) + (*compile-file-position* 0 (file-position object)) + (form (si::read-object-or-ignore object eof) + (si::read-object-or-ignore object eof))) ((eq form eof)) (when form (setf (cdr ext:*source-location*)