X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fxref.lisp;h=4bf2fd08582705a748eff9f5c6bea4bf915c6e77;hb=95591ed483dbb8c0846c129953acac1554f28809;hp=4ea73e42151432901a2920c4c1c94acbd6a398e8;hpb=3b6e07c0fcb050fa86c7c42db33f49107e3097e6;p=sbcl.git diff --git a/src/compiler/xref.lisp b/src/compiler/xref.lisp index 4ea73e4..4bf2fd0 100644 --- a/src/compiler/xref.lisp +++ b/src/compiler/xref.lisp @@ -19,17 +19,15 @@ (return-from record-component-xrefs)) (do ((block (block-next (component-head component)) (block-next block))) ((null (block-next block))) - (let* ((this-cont (block-start block)) - (last (block-last block))) + (let ((start (block-start block))) (flet ((handle-node (functional) ;; Record xref information for all nodes in the block. ;; Note that this code can get executed several times ;; for the same block, if the functional is referenced ;; from multiple XEPs. - (loop for node = (ctran-next this-cont) - then (ctran-next (node-next node)) - until (eq node last) - do (record-node-xrefs node functional)) + (loop for ctran = start then (node-next (ctran-next ctran)) + while ctran + do (record-node-xrefs (ctran-next ctran) functional)) ;; Properly record the deferred macroexpansion information ;; that's been stored in the block. (dolist (xref-data (block-macroexpands block)) @@ -81,7 +79,7 @@ (defun record-node-xrefs (node context) (declare (type node node)) (etypecase node - ((or creturn cif entry mv-combination cast)) + ((or creturn cif entry mv-combination cast exit)) (combination ;; Record references to globals made using SYMBOL-VALUE. (let ((fun (principal-lvar-use (combination-fun node))) @@ -103,24 +101,13 @@ (record-xref :calls name context node nil))))) ;; Inlined global function (clambda - (when (functional-inlinep leaf) - (let ((name (leaf-debug-name leaf))) - ;; FIXME: we should store the original var into the - ;; functional when creating inlined-functionals, so that - ;; we could just check whether it was a global-var, - ;; rather then needing to guess based on the debug-name. - (when (or (symbolp name) - ;; Any non-SETF non-symbol names will - ;; currently be either non-functions or - ;; internals. - (and (consp name) - (equal (car name) 'setf))) - ;; TODO: a WHO-INLINES xref-kind could be useful - (record-xref :calls name context node nil))))) + (let ((inline-var (functional-inline-expanded leaf))) + (when (global-var-p inline-var) + ;; TODO: a WHO-INLINES xref-kind could be useful + (record-xref :calls (leaf-debug-name inline-var) context node nil)))) ;; Reading a constant (constant - (let* ((name (constant-%source-name leaf))) - (record-xref :references name context node nil)))))) + (record-xref :references (ref-%source-name node) context node nil))))) ;; Setting a special variable (cset (let* ((var (set-var node))) @@ -151,15 +138,21 @@ (list (every #'internal-name-p what)) (symbol - (member (symbol-package what) - (load-time-value (list* (find-package "COMMON-LISP") - (find-package "KEYWORD") - (remove-if-not - (lambda (package) - (= (mismatch "SB!" - (package-name package)) - 3)) - (list-all-packages)))))) + (or (eq '.anonymous. what) + (member (symbol-package what) + (load-time-value (list* (find-package "COMMON-LISP") + (find-package "KEYWORD") + #+sb-xc-host (find-package "SB-XC") + (remove-if-not + (lambda (package) + (= (mismatch "SB!" + (package-name package)) + 3)) + (list-all-packages))))) + #+sb-xc-host ; again, special case like in genesis and dump + (multiple-value-bind (cl-symbol cl-status) + (find-symbol (symbol-name what) sb!int:*cl-package*) + (and (eq what cl-symbol) (eq cl-status :external))))) (t t))) (defun record-xref (kind what context node path)