- (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))))))))
+ (let* ((*lexenv* (node-lexenv use))
+ (leaf (ref-leaf use))
+ (name
+ (cond ((global-var-p leaf)
+ ;; Case 1: #'NAME
+ (and (eq (global-var-kind leaf) :global-function)
+ (car (member (leaf-source-name leaf) names
+ :test #'equal))))
+ ((constant-p leaf)
+ (let ((value (constant-value leaf)))
+ (car (if (functionp value)
+ ;; Case 2: #.#'NAME
+ (member value names
+ :key (lambda (name)
+ (and (fboundp name)
+ (fdefinition name)))
+ :test #'eq)
+ ;; Case 3: 'NAME
+ (member value names
+ :test #'equal))))))))
+ (and name
+ (not (fun-lexically-notinline-p name)))))))