[Openmcl-devel] Cross-Referencing facility for OpenMCL

Oliver Markovic entrox at entrox.org
Mon Dec 8 20:35:04 UTC 2003


Hi,

Attached is a patch which adds cross-referencing abilities to OpenMCL. 
The
API is basically the same as the one in Allegro with a few small changes
(GET-RELATION returns structures, not symbols and there's a new keyword 
to
get a little more output).
This is something I whipped up on a boring weekend after I got jealous 
at
CMUCL users and their nice xref facility for SLIME[1], so I'm sure 
there are a
lot of improvements possible, since I'm totally new to the compiler 
internals.

Here's a short example:

Welcome to OpenMCL Version (Alpha: Darwin) 0.14-031108!
? (require :xref)
"XREF"
? (start-xref)
T
? (compile-file "lib/xref.lisp")
#P"/Users/qgo/Coding/cvs/ccl/lib/xref.dfsl"
NIL
NIL
? (who-calls 'get-relation)

  GET-RELATION is directly called by:
      WHO-SETS
      WHO-REFERENCES
      WHO-BINDS
      MACROS-CALLED-BY
      WHO-INDIRECTLY-CALLS
      WHO-DIRECTLY-CALLS

  No indirect callers of GET-RELATION were found in the database

  No macro callers of GET-RELATION were found in the database

? (who-uses '*standard-output*)

  No bindings of *STANDARD-OUTPUT* were found in the database

  *STANDARD-OUTPUT* is referenced by:
      WHO-USES
      WHO-SETS
      WHO-REFERENCES
      WHO-BINDS
      WHO-CALLS
      MACROS-CALLED-BY
      WHO-INDIRECTLY-CALLS
      WHO-DIRECTLY-CALLS

  No settings of *STANDARD-OUTPUT* were found in the database

? (who-calls 'get-relation :inverse t)

  GET-RELATION directly calls:
      CONCATENATE
      ADJOIN-EQL
      MAKE-XREF-ENTRY
      ADJOIN
      CALLERS
      %DO-SIMPLE-XREF-LOOKUP
      %DO-WILD-XREF-LOOKUP
      %XREF-TABLE
      ERROR

  No indirect callees of GET-RELATION were found in the database

  GET-RELATION macro calls:
      PUSHNEW
      DOLIST
      COND
      ECASE
      AND
      WHEN
?

Two major things are missing: it doesn't detect indirect calls i.e. 
something
like (let ((func #'foo)) (funcall func)) and the xref information isn't 
saved. I briefly
looked at the FASL loading/dumping code, but quickly concluded that I 
don't
understand enough to try something like this.

I will also send patches to the SLIME people, if this should get 
merged, so we
could lift the OpenMCL port to nearly-fully-supported state :-)

The patch is against the 0.14-031108 release.

[1] http://www.common-lisp.net/project/slime/
--
   Oliver Markovic

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xref.patch
Type: application/octet-stream
Size: 30006 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20031208/d1425908/attachment.obj>


More information about the Openmcl-devel mailing list