X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefmacro.lisp;h=d45a27c0603bfc80e4e99eb73919240013d93978;hb=6fa968aaa8051da23cc3153a1c0e67addbea85f6;hp=edbc93cdb8b8a1dcfc2501d6e1e50a00e33301c9;hpb=9c9c68bd6e5e3c6d02e9f1bfd583b87bb9e85eea;p=sbcl.git diff --git a/src/code/defmacro.lisp b/src/code/defmacro.lisp index edbc93c..d45a27c 100644 --- a/src/code/defmacro.lisp +++ b/src/code/defmacro.lisp @@ -33,17 +33,24 @@ name)) (with-unique-names (whole environment) (multiple-value-bind (new-body local-decs doc) - (parse-defmacro lambda-list whole body name 'defmacro - :environment environment) - (let ((def `(lambda (,whole ,environment) - ,@local-decs + (parse-defmacro lambda-list whole body name 'defmacro + :environment 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 #-sb-xc-host named-lambda (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 (debug-namify "DEFMACRO ~S" name))) - `(eval-when (:compile-toplevel :load-toplevel :execute) - (sb!c::%defmacro ',name #',def ',lambda-list ,doc ,debug-name))))))) + (debug-name (sb!c::debug-name 'macro-function name))) + `(eval-when (:compile-toplevel :load-toplevel :execute) + (sb!c::%defmacro ',name #',def ',lambda-list + ,doc ',debug-name))))))) (macrolet ((def (times set-p) @@ -90,11 +97,11 @@ (#.sb!vm:closure-header-widetag (setf (%simple-fun-arglist (%closure-fun definition)) lambda-list - (%simple-fun-name (%closure-fun definition)) - debug-name)) + (%simple-fun-name (%closure-fun definition)) + debug-name)) (#.sb!vm:simple-fun-header-widetag (setf (%simple-fun-arglist definition) lambda-list - (%simple-fun-name definition) debug-name)))) + (%simple-fun-name definition) debug-name)))) name)))) (progn (def (:load-toplevel :execute) #-sb-xc-host t #+sb-xc-host nil)