X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefmacro.lisp;h=5bc4f4704d395178b38853e9a422713da476a08a;hb=8eee0d3a30bf39d9f201acff28c92059fe6c3e4e;hp=21caf2d7612aefd9590b9961b815a40e8a830d6e;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/defmacro.lisp b/src/code/defmacro.lisp index 21caf2d..5bc4f47 100644 --- a/src/code/defmacro.lisp +++ b/src/code/defmacro.lisp @@ -35,12 +35,18 @@ (multiple-value-bind (new-body local-decs doc) (parse-defmacro lambda-list whole body name 'defmacro :environment environment) - (let ((def `(lambda (,whole ,environment) + (let ((def `(#+sb-xc-host lambda + ;; Use a named-lambda rather than a lambda so that + ;; proper xref information can be stored. Use a + ;; list-based name, since otherwise the compiler + ;; will momentarily assume that it names a normal + ;; function, and report spurious warnings about + ;; redefinition a macro as a function, and then + ;; vice versa. + #-sb-xc-host named-lambda #-sb-xc-host (defmacro ,name) + (,whole ,environment) ,@local-decs ,new-body)) - ;; If we want to move over to list-style names - ;; [e.g. (DEFMACRO FOO), maybe to support some XREF-like - ;; functionality] here might be a good place to start. (debug-name (sb!c::debug-name 'macro-function name))) `(eval-when (:compile-toplevel :load-toplevel :execute) (sb!c::%defmacro ',name #',def ',lambda-list