X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fknownfun.lisp;h=e12181513dec21e881f2fc81d37c0c566883ff17;hb=d94c1b4a8c534bde146823f56558faf37cd4c4d7;hp=078b9f103128eab5feab65b5fda026dcf56ae9bf;hpb=34360bf475b3632f625fcc263f626557ef96d94f;p=sbcl.git diff --git a/src/compiler/knownfun.lisp b/src/compiler/knownfun.lisp index 078b9f1..e121815 100644 --- a/src/compiler/knownfun.lisp +++ b/src/compiler/knownfun.lisp @@ -131,7 +131,10 @@ (templates nil :type list) ;; If non-null, then this function is a unary type predicate for ;; this type. - (predicate-type nil :type (or ctype null))) + (predicate-type nil :type (or ctype null)) + ;; If non-null, the index of the argument which becomes the result + ;; of the function. + (result-arg nil :type (or index null))) (defprinter (fun-info) (attributes :test (not (zerop attributes)) @@ -182,7 +185,8 @@ (eq (transform-important x) important))) (fun-info-transforms info)))) (cond (old - (style-warn "Overwriting ~S" old) + (style-warn 'sb!kernel:redefinition-with-deftransform + :transform old) (setf (transform-function old) fun (transform-note old) note)) (t @@ -196,15 +200,17 @@ (declaim (ftype (function (list list attributes &key (:derive-type (or function null)) (:optimizer (or function null)) - (:destroyed-constant-args (or function null))) + (:destroyed-constant-args (or function null)) + (:result-arg (or index null))) *) %defknown)) -(defun %defknown (names type attributes &key derive-type optimizer destroyed-constant-args) +(defun %defknown (names type attributes &key derive-type optimizer destroyed-constant-args result-arg) (let ((ctype (specifier-type type)) (info (make-fun-info :attributes attributes :derive-type derive-type :optimizer optimizer - :destroyed-constant-args destroyed-constant-args)) + :destroyed-constant-args destroyed-constant-args + :result-arg result-arg)) (target-env *info-environment*)) (dolist (name names) (let ((old-fun-info (info :function :info name)))