Skip to content
Snippets Groups Projects
Commit 1e8d3d25 authored by wlott's avatar wlott
Browse files

Bind *backend* to *native-backend* in compile-from-stream and compile.

Bind *info-environment* to the backend specific info environment (if there
is one) before compiling anything.
parent 73b64462
No related branches found
No related tags found
No related merge requests found
...@@ -859,17 +859,7 @@ ...@@ -859,17 +859,7 @@
;;; source path. ;;; source path.
;;; ;;;
(defun preprocessor-macroexpand (form) (defun preprocessor-macroexpand (form)
(handler-case #+new-compiler (macroexpand-1 form *lexical-environment*) (handler-case (macroexpand-1 form *lexical-environment*)
#-new-compiler
(let ((fenv (lexenv-functions *lexical-environment*)))
(if (consp form)
(let* ((name (car form))
(exp (or (cddr (assoc name fenv))
(info function macro-function name))))
(if exp
(funcall exp form fenv)
form))
form))
(error (condition) (error (condition)
(compiler-error "(during macroexpansion)~%~A" condition)))) (compiler-error "(during macroexpansion)~%~A" condition))))
...@@ -1110,7 +1100,10 @@ ...@@ -1110,7 +1100,10 @@
(*last-source-form* nil) (*last-source-form* nil)
(*last-format-string* nil) (*last-format-string* nil)
(*last-format-args* nil) (*last-format-args* nil)
(*last-message-count* 0)) (*last-message-count* 0)
(*info-environment*
(or (backend-info-environment *backend*)
*info-environment*)))
(with-compilation-unit () (with-compilation-unit ()
(loop (loop
(multiple-value-bind (form tlf eof-p) (multiple-value-bind (form tlf eof-p)
...@@ -1178,7 +1171,8 @@ ...@@ -1178,7 +1171,8 @@
If true, then function names will be resolved at compile time. If true, then function names will be resolved at compile time.
:Source-Info :Source-Info
Some object to be placed in the DEBUG-SOURCE-INFO." Some object to be placed in the DEBUG-SOURCE-INFO."
(let ((info (make-stream-source-info stream))) (let ((info (make-stream-source-info stream))
(*backend* *native-backend*))
(unwind-protect (unwind-protect
(let ((won (sub-compile-file info (make-core-object) source-info))) (let ((won (sub-compile-file info (make-core-object) source-info)))
(values (not (null won)) (values (not (null won))
...@@ -1393,7 +1387,11 @@ ...@@ -1393,7 +1387,11 @@
(with-compilation-unit () (with-compilation-unit ()
(with-ir1-namespace (with-ir1-namespace
(clear-stuff) (clear-stuff)
(let* ((start-errors *compiler-error-count*) (let* ((*backend* *native-backend*)
(*info-environment*
(or (backend-info-environment *backend*)
*info-environment*))
(start-errors *compiler-error-count*)
(start-warnings *compiler-warning-count*) (start-warnings *compiler-warning-count*)
(start-notes *compiler-note-count*) (start-notes *compiler-note-count*)
(*lexical-environment* (make-null-environment)) (*lexical-environment* (make-null-environment))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment