Skip to content
Snippets Groups Projects
Commit e00d145c authored by ram's avatar ram
Browse files

When seeing to replace a transform, check that it has the same note as well as

the same type.  This provides a way to have more than one transform with the
same type signature.
parent a3bb1455
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/knownfun.lisp,v 1.13 1991/11/12 16:11:22 ram Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/knownfun.lisp,v 1.14 1992/01/31 19:10:22 ram Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -152,7 +152,7 @@
;;; %Deftransform -- Internal
;;;
;;; Grab the Function-Info and enter the function, replacing any old one
;;; with the same type.
;;; with the same type and note.
;;;
(proclaim '(function %deftransform
(t list function &optional (or string null))))
......@@ -160,8 +160,10 @@
(let* ((ctype (specifier-type type))
(note (or note "optimize"))
(info (function-info-or-lose name))
(old (find ctype (function-info-transforms info)
:key #'transform-type :test #'type=)))
(old (find-if #'(lambda (x)
(and (type= (transform-type x) ctype)
(string-equal (transform-note x) note)))
(function-info-transforms info))))
(if old
(setf (transform-function old) fun (transform-note old) note)
(push (make-transform :type ctype :function fun :note note)
......
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