0.pre7.50:
[sbcl.git] / src / compiler / knownfun.lisp
index 839ab45..f110444 100644 (file)
   (predicate-type nil :type (or ctype null))
   ;; If non-null, use this function to annotate the known call for the byte
   ;; compiler. If it returns NIL, then change the call to :full.
-  (byte-annotate nil :type (or function null))
-  ;; If non-null, use this function to generate the byte code for this known
-  ;; call. This function can only give up if there is a byte-annotate function
-  ;; that arranged for the functional to be pushed onto the stack.
-  (byte-compile nil :type (or function null)))
+  (byte-annotate nil :type (or function null)))
 
 (defprinter (function-info)
   (transforms :test transforms)
   (ir2-convert :test ir2-convert)
   (templates :test templates)
   (predicate-type :test predicate-type)
-  (byte-annotate :test byte-annotate)
-  (byte-compile :test byte-compile))
+  (byte-annotate :test byte-annotate))
 \f
 ;;;; interfaces to defining macros
 
   ;; the transformation function. Takes the COMBINATION node and returns a
   ;; lambda, or throws out.
   (function (required-argument) :type function)
-  ;; string used in efficency notes
+  ;; string used in efficiency notes
   (note (required-argument) :type string)
   ;; T if we should emit a failure note even if SPEED=INHIBIT-WARNINGS.
   (important nil :type (member t nil))
-  ;; usable for byte code, native code, or both
+  ;; usable for byte code, native code, or both?
+  ;;
+  ;; FIXME: Now that there's no byte compiler, this is stale and could
+  ;; all go away.
   (when :native :type (member :byte :native :both)))
 
 (defprinter (transform) type note important when)
        (info (make-function-info :attributes attributes
                                  :derive-type derive-type
                                  :optimizer optimizer))
-       (target-env (or *backend-info-environment* *info-environment*)))
+       (target-env *info-environment*))
     (dolist (name names)
-      (when (info :function :info name)
-        ;; This is an error because it's generally a bad thing to blow
-        ;; away all the old optimization stuff. It's also a potential
-        ;; source of sneaky bugs:
-        ;;    DEFKNOWN FOO
-        ;;    DEFTRANSFORM FOO
-        ;;    DEFKNOWN FOO ; possibly hidden inside some macroexpansion
-        ;;    ; Now the DEFTRANSFORM doesn't exist in the target Lisp.
-        ;; However, it's continuable because it might be useful to do
-        ;; it when testing new optimization stuff interactively.
-       #+nil (cerror "Go ahead, overwrite it."
-                     "overwriting old FUNCTION-INFO for ~S" name)
-       (warn "overwriting old FUNCTION-INFO for ~S" name))
+      (let ((old-function-info (info :function :info name)))
+       (when old-function-info
+         ;; This is handled as an error because it's generally a bad
+         ;; thing to blow away all the old optimization stuff. It's
+         ;; also a potential source of sneaky bugs:
+         ;;    DEFKNOWN FOO
+         ;;    DEFTRANSFORM FOO
+         ;;    DEFKNOWN FOO ; possibly hidden inside some macroexpansion
+         ;;    ; Now the DEFTRANSFORM doesn't exist in the target Lisp.
+         ;; However, it's continuable because it might be useful to do
+         ;; it when testing new optimization stuff interactively.
+         (cerror "Go ahead, overwrite it."
+                 "~@<overwriting old FUNCTION-INFO ~2I~_~S ~I~_for ~S~:>"
+                 old-function-info name)))
       (setf (info :function :type name target-env) ctype)
       (setf (info :function :where-from name target-env) :declared)
       (setf (info :function :kind name target-env) :function)
 ;;; through here.
 (declaim (ftype (function (t) function-info) function-info-or-lose))
 (defun function-info-or-lose (name)
-  (let ((*info-environment* (or *backend-info-environment*
-                               *info-environment*)))
+  (let (;; FIXME: Do we need this rebinding here? It's a literal
+       ;; translation of the old CMU CL rebinding to
+       ;; (OR *BACKEND-INFO-ENVIRONMENT* *INFO-ENVIRONMENT*),
+       ;; and it's not obvious whether the rebinding to itself is
+       ;; needed that SBCL doesn't need *BACKEND-INFO-ENVIRONMENT*.
+       (*info-environment* *info-environment*))
     (let ((old (info :function :info name)))
       (unless old (error "~S is not a known function." name))
       (setf (info :function :info name) (copy-function-info old)))))