X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1tran-lambda.lisp;h=b1ee7ee22260516686a85e02a9ce54f67f5633d4;hb=5745b5a5b2e3b967bf3876b4306f31b3c78495fa;hp=33fd5fd7a30808a95da9bcd4e20ab809b4c49ca8;hpb=513f06e6c91af7a52c8c037d71386845b1c21a0f;p=sbcl.git diff --git a/src/compiler/ir1tran-lambda.lisp b/src/compiler/ir1tran-lambda.lisp index 33fd5fd..b1ee7ee 100644 --- a/src/compiler/ir1tran-lambda.lisp +++ b/src/compiler/ir1tran-lambda.lisp @@ -1147,6 +1147,27 @@ (setf (functional-inlinep fun) inlinep) (assert-new-definition var fun) (setf (defined-fun-inline-expansion var) expansion) + ;; Associate VAR with the FUN -- and in case of an optional dispatch + ;; with the various entry-points. This allows XREF to know where the + ;; inline CLAMBDA comes from. + (flet ((note-inlining (f) + (typecase f + (functional + (setf (functional-inline-expanded f) var)) + (cons + ;; Delayed entry-point. + (if (car f) + (setf (functional-inline-expanded (cdr f)) var) + (let ((old-thunk (cdr f))) + (setf (cdr f) (lambda () + (let ((g (funcall old-thunk))) + (setf (functional-inline-expanded g) var) + g))))))))) + (note-inlining fun) + (when (optional-dispatch-p fun) + (note-inlining (optional-dispatch-main-entry fun)) + (note-inlining (optional-dispatch-more-entry fun)) + (mapc #'note-inlining (optional-dispatch-entry-points fun)))) ;; substitute for any old references (unless (or (not *block-compile*) (and info