X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1util.lisp;h=99e2ef896c56e44f750d3a2b86d624fca21124bb;hb=0cff6b0b7e6f1d148586f81f620b9c86ed217caa;hp=2beb884520cc2d15441216f0e0b358a01964e13c;hpb=6822034325136cde4e14773c83c3769b42721306;p=sbcl.git diff --git a/src/compiler/ir1util.lisp b/src/compiler/ir1util.lisp index 2beb884..99e2ef8 100644 --- a/src/compiler/ir1util.lisp +++ b/src/compiler/ir1util.lisp @@ -1926,14 +1926,14 @@ (setf (block-reoptimize (node-block node)) t) (reoptimize-component (node-component node) :maybe))))))) -;;; True if LVAR is for 'NAME, or #'NAME (global, not local) -(defun lvar-for-named-function (lvar name) - (if (constant-lvar-p lvar) - (eq name (lvar-value lvar)) - (let ((use (lvar-uses lvar))) - (and (not (listp use)) - (ref-p use) - (let ((leaf (ref-leaf use))) - (and (global-var-p leaf) - (eq :global-function (global-var-kind leaf)) - (eq name (leaf-source-name leaf)))))))) +;;; Return true if LVAR's only use is a non-NOTINLINE reference to a +;;; global function with one of the specified NAMES. +(defun lvar-fun-is (lvar names) + (declare (type lvar lvar) (list names)) + (let ((use (lvar-uses lvar))) + (and (ref-p use) + (let ((leaf (ref-leaf use))) + (and (global-var-p leaf) + (eq (global-var-kind leaf) :global-function) + (not (null (member (leaf-source-name leaf) names + :test #'equal))))))))