X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefstruct.lisp;h=2cd30d7ee7b6bcf04fffa073518e158131e33fad;hb=93be0089fe7b2a9e34bf1cb6da9fe6e902769f5e;hp=5b6004d85aaa43e320b68d06e819ef34b9661a52;hpb=34664ac9b1d27f0dff2514c388cf10813a9b1108;p=sbcl.git diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 5b6004d..2cd30d7 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -360,7 +360,7 @@ ;; class. (with-single-package-locked-error (:symbol ',name "defining ~A as a structure")) - (%defstruct ',dd ',inherits) + (%defstruct ',dd ',inherits (sb!c:source-location)) (eval-when (:compile-toplevel :load-toplevel :execute) (%compiler-defstruct ',dd ',inherits)) ,@(unless expanding-into-code-for-xc-host-p @@ -376,6 +376,9 @@ (:symbol ',name "defining ~A as a structure")) (eval-when (:compile-toplevel :load-toplevel :execute) (setf (info :typed-structure :info ',name) ',dd)) + (eval-when (:load-toplevel :execute) + (setf (info :source-location :typed-structure ',name) + (sb!c:source-location))) ,@(unless expanding-into-code-for-xc-host-p (append (typed-accessor-definitions dd) (typed-predicate-definitions dd) @@ -858,7 +861,7 @@ ;;; incompatible redefinition. Define those functions which are ;;; sufficiently stereotyped that we can implement them as standard ;;; closures. -(defun %defstruct (dd inherits) +(defun %defstruct (dd inherits source-location) (declare (type defstruct-description dd)) ;; We set up LAYOUTs even in the cross-compilation host. @@ -878,6 +881,9 @@ (setq layout (classoid-layout classoid)))) (setf (find-classoid (dd-name dd)) classoid) + (sb!c:with-source-location (source-location) + (setf (layout-source-location layout) source-location)) + ;; Various other operations only make sense on the target SBCL. #-sb-xc-host (%target-defstruct dd layout)) @@ -941,8 +947,7 @@ ;; default. (But note ;; FUNCALLABLE-STRUCTUREs need ;; assistance here) - (inherits (vector (find-layout t) - (find-layout 'instance)))) + (inherits (vector (find-layout t)))) (multiple-value-bind (classoid layout old-layout) (multiple-value-bind (clayout clayout-p) @@ -1531,9 +1536,9 @@ ;; and it's not a general-purpose facility, so sanity check our ;; own code. (structure - (aver (eq superclass-name 'instance))) + (aver (eq superclass-name 't))) (funcallable-structure - (aver (eq superclass-name 'funcallable-instance))) + (aver (eq superclass-name 'function))) (t (bug "Unknown DD-TYPE in ALTERNATE-METACLASS: ~S" dd-type))) (setf (dd-alternate-metaclass dd) (list superclass-name metaclass-name @@ -1657,7 +1662,7 @@ ;; Note: This has an ALTERNATE-METACLASS only because of blind ;; clueless imitation of the CMU CL code -- dunno if or why it's ;; needed. -- WHN - (dd-alternate-metaclass dd) '(instance) + (dd-alternate-metaclass dd) '(t) (dd-slots dd) nil (dd-length dd) 1 (dd-type dd) 'structure)