[Openmcl-devel] "internal" functions and xref

Gail Zacharias gz at clozure.com
Tue Nov 18 16:10:22 UTC 2008


At 11/18/2008 03:25 AM, Takehiko Abe wrote:
>(while trying to fix slime's who-calls for ccl-1.3, I noticed)
>
>ccl::make-xref-entry returns bogus xrefs when it is given "internal"
>functions.

This is now fixed in the trunk, pretty much as you suggested.


>Example:
>
>    $ ccl -n
>    Welcome to Clozure Common Lisp Version 1.3-dev-r  (LinuxX8664)!
>    ? (require 'xref)
>    XREF
>    ("XREF")
>    ? (ccl::callers 'print-object)
>    (#<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT
>(INSPECTOR::UNBOUND-MARKER T)>
>     #<CCL::STANDARD-KERNEL-METHOD CCL::REPORT-CONDITION (CONDITION T)>
>     CCL::WRITE-A-FROB #<CCL::STANDARD-KERNEL-METHOD PRINT-OBJECT
>(COMPLEX T)>
>     (:INTERNAL (PRINT-OBJECT (CLASS T)))
>     (:INTERNAL (PRINT-OBJECT (STANDARD-OBJECT T)))
>     (:INTERNAL CCL::WRITE-AN-ISTRUCT))
>    ? (car (last *))
>    (:INTERNAL CCL::WRITE-AN-ISTRUCT)
>    ? (ccl::make-xref-entry * :direct-calls)
>    #<XREF-ENTRY INTERNAL METHOD (WRITE-AN-ISTRUCT)>
>    ?
>
>A simple fix I came up with was to add a new CASE clause for :internal:
>
>(defun make-xref-entry (input relation)
>    (etypecase input
>      (symbol
>       ...)
>      (method
>       ...)
>      (cons
>       (case (car input)
>         ((ppc-lap-macro compiler-macro-function)
>          ...)
>+      ((:internal)
>+       (make-xref-entry (cadr input) relation))
>         (t
>          )))))
>
>But then I noticed that there are inputs for flet/labels local
>functions too. e.g.
>
>    ? (ccl::callers 'ccl::%multiply-and-add-loop)
>    ((:INTERNAL CCL::MULTIPLY-UNSIGNED-BIGNUMS CCL::MULTIPLY-BIGNUMS))
>
>So make-xref-entry now becomes:
>
>(defun make-xref-entry (input relation)
>    (etypecase input
>      (symbol
>       ...)
>      (method
>       ...)
>      (cons
>       (case (car input)
>         ((ppc-lap-macro compiler-macro-function)
>          ...)
>+      ((:internal)
>+       (if (= (length input) 3)
>+         (make-xref-entry (nth 2 input) relation)
>+         (make-xref-entry (cadr input) relation)))
>         (t
>          )))))
>
>Bah. I feel like I should ask what these "internal" functions are.
>
>regards,
>T.
>_______________________________________________
>Openmcl-devel mailing list
>Openmcl-devel at clozure.com
>http://clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list