X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fknownfun.lisp;h=84799f178a5ce5a3cad8af6c054d162913297466;hb=7c07a6f965c51828d8f452b47e0620d8e6cf2959;hp=5a30ffc45583e107414caed4fbc6400669065deb;hpb=ce02ab2ecd9c6ae2e570abd8c93ebf3be55bbdad;p=sbcl.git diff --git a/src/compiler/knownfun.lisp b/src/compiler/knownfun.lisp index 5a30ffc..84799f1 100644 --- a/src/compiler/knownfun.lisp +++ b/src/compiler/knownfun.lisp @@ -171,6 +171,20 @@ :optimizer optimizer)) (target-env (or *backend-info-environment* *info-environment*))) (dolist (name names) + (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." + "~@" + 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) @@ -178,7 +192,7 @@ names) ;;; Return the FUNCTION-INFO for NAME or die trying. Since this is -;;; used by people who want to modify the info, and the info may be +;;; used by callers who want to modify the info, and the info may be ;;; shared, we copy it. We don't have to copy the lists, since each ;;; function that has generators or transforms has already been ;;; through here.