From 6e197c06407da63145af0313c040739659077d14 Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Tue, 11 May 1993 13:55:34 +0000 Subject: [PATCH] Add support for When attribute of IR1 transforms. --- compiler/knownfun.lisp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/knownfun.lisp b/compiler/knownfun.lisp index a3f4efa1b..772e0b96c 100644 --- a/compiler/knownfun.lisp +++ b/compiler/knownfun.lisp @@ -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.18 1993/02/26 08:38:56 ram Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/knownfun.lisp,v 1.19 1993/05/11 13:55:34 ram Exp $") ;;; ;;; ********************************************************************** ;;; @@ -159,9 +159,12 @@ (note (required-argument) :type string) ;; ;; T if we should spew a failure note even if speed=brevity. - (important nil :type (member t nil))) + (important nil :type (member t nil)) + ;; + ;; Usable for byte code, native code, or both. + (when :native :type (member :byte :native :both))) -(defprinter transform type note) +(defprinter transform type note important when) ;;; %Deftransform -- Internal @@ -171,20 +174,21 @@ ;;; (proclaim '(function %deftransform (t list function &optional (or string null) - (member t nil)))) -(defun %deftransform (name type fun &optional note important) + (member t nil) (member :native :byte :both)))) +(defun %deftransform (name type fun &optional note important when) (let* ((ctype (specifier-type type)) (note (or note "optimize")) (info (function-info-or-lose name)) (old (find-if #'(lambda (x) (and (type= (transform-type x) ctype) (string-equal (transform-note x) note) - (eq (transform-important x) important))) + (eq (transform-important x) important) + (eq (transform-when x) when))) (function-info-transforms info)))) (if old (setf (transform-function old) fun (transform-note old) note) (push (make-transform :type ctype :function fun :note note - :important important) + :important important :when when) (function-info-transforms info))) name)) -- GitLab