1.0.17.35: Bug fixes: cross-compiler's lookup of constants, recursive escaping
authorpkhuong <pkhuong>
Sun, 15 Jun 2008 11:13:41 +0000 (11:13 +0000)
committerpkhuong <pkhuong>
Sun, 15 Jun 2008 11:13:41 +0000 (11:13 +0000)
 * Reinstate :CONSTANT-VALUE in the infodb as :XC-CONSTANT-VALUE
   during cross-compilation, since we can't override our host's
   standard constants.

 * Avoid recursive escaping in BLOCK-GENSYM.

src/code/primordial-extensions.lisp
src/compiler/defconstant.lisp
src/compiler/globaldb.lisp
src/compiler/ir1tran.lisp
src/compiler/node.lisp
version.lisp-expr

index d9d0d0e..e28cb0e 100644 (file)
   (let ((block-name (when env
                       (car (find-if #'car (sb!c::lexenv-blocks env))))))
     (if block-name
-        (gensym (format nil "~A[~S]" name block-name))
+        (gensym (format nil "~A[~A]" name block-name))
         (gensym name))))
 
 
index 5f155eb..0b6f423 100644 (file)
@@ -99,6 +99,10 @@ the usual naming convention (names like *FOO*) for special variables"
       ;; doubt such warnings are ANSI-compliant, but I'm not sure, so I've
       ;; written this in a way that CMU CL will tolerate and which ought to
       ;; work elsewhere too.) -- WHN 2001-03-24
-      (eval `(defconstant ,name ',value))))
+      (eval `(defconstant ,name ',value)))
+    ;; It would certainly be awesome if this was only needed for symbols
+    ;; in CL. Unfortunately, that is not the case. Maybe some are moved
+    ;; back in CL later on?
+    (setf (info :variable :xc-constant-value name) value))
   (setf (info :variable :kind name) :constant)
   name)
index 8436730..1fbdb7c 100644 (file)
   :type-spec (member :declared :assumed :defined)
   :default :assumed)
 
+;;; We only need a mechanism different from the
+;;; usual SYMBOL-VALUE for the cross compiler.
+#+sb-xc-host
+(define-info-type
+  :class :variable
+  :type :xc-constant-value
+  :type-spec t
+  :default nil)
+
 ;;; the macro-expansion for symbol-macros
 (define-info-type
   :class :variable
index 91b7a69..3e38ef7 100644 (file)
                        (type (type-specifier (info :variable :type name))))
                    `(macro . (the ,type ,expansion))))
                 (:constant
-                 (find-constant (symbol-value name) name))
+                 (let ((value (symbol-value name)))
+                   ;; Override the values of standard symbols in XC,
+                   ;; since we can't redefine them.
+                   #+sb-xc-host
+                   (when (eql (find-symbol (symbol-name name) :cl) name)
+                     (multiple-value-bind (xc-value foundp)
+                         (info :variable :xc-constant-value name)
+                       (cond (foundp
+                              (setf value xc-value))
+                             ((not (eq value name))
+                              (compiler-warn
+                               "Using cross-compilation host's definition of ~S: ~A~%"
+                               name (symbol-value name))))))
+                   (find-constant value name)))
                 (t
                  (make-global-var :kind kind
                                   :%source-name name
index afcb90d..fb27f29 100644 (file)
 (def!struct (constant (:constructor make-constant (value
                                                    &aux
                                                    (type (ctype-of value))
-                                                   (%source-name '.anonynous.)
+                                                   (%source-name '.anonymous.)
                                                    (where-from :defined)))
                       (:include leaf))
   ;; the value of the constant
index 1d46a77..39393ca 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.17.34"
+"1.0.17.35"