From 4c3c1c2a10a7c6be81efb39a4fe616bfaed597b4 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 23 Apr 2010 13:23:29 +0000
Subject: [PATCH] Add source location info for defstructs and deftypes.

code/defstruct.lisp:
o Save source info for defstructs

code/macros.lisp:
o Save source info for deftypes.

compiler/globaldb.lisp:
o Add comments that the info type source-location defvar also includes
  defparameter, defconstant, defstruct, and deftype.
---
 code/defstruct.lisp    | 4 +++-
 code/macros.lisp       | 3 ++-
 compiler/globaldb.lisp | 8 +++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/code/defstruct.lisp b/code/defstruct.lisp
index 8f27b0f7b..a03b866c1 100644
--- a/code/defstruct.lisp
+++ b/code/defstruct.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/defstruct.lisp,v 1.101 2010/04/20 17:57:44 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/defstruct.lisp,v 1.102 2010/04/23 13:23:29 rtoy Rel $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -487,6 +487,7 @@
 	     ,@(define-raw-accessors defstruct)
 	     ,@(define-constructors defstruct)
 	     ,@(define-class-methods defstruct)
+	     (lisp::set-defvar-source-location ',name (c::source-location))
 	   ',name))
 	`(progn
 	   (eval-when (compile load eval)
@@ -495,6 +496,7 @@
 	   ,@(define-predicate defstruct)
 	   ,@(define-accessors defstruct)
 	   ,@(define-copier defstruct)
+	   (lisp::set-defvar-source-location ',name (c::source-location))
 	   ',name))))
 	   
 
diff --git a/code/macros.lisp b/code/macros.lisp
index d1ef3e9e6..9ea8d3233 100644
--- a/code/macros.lisp
+++ b/code/macros.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.117 2010/04/20 17:57:44 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.118 2010/04/23 13:23:29 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -242,6 +242,7 @@
       (when doc
 	(intl::note-translatable intl::*default-domain* doc))
       `(eval-when (:compile-toplevel :load-toplevel :execute)
+	 (set-defvar-source-location ',name (c::source-location))
 	 (%deftype ',name
 		   #'(lambda (,whole)
 		       ,@local-decs
diff --git a/compiler/globaldb.lisp b/compiler/globaldb.lisp
index 7bbd0c812..89066a6d9 100644
--- a/compiler/globaldb.lisp
+++ b/compiler/globaldb.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/globaldb.lisp,v 1.56 2010/04/20 17:57:46 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/globaldb.lisp,v 1.57 2010/04/23 13:23:29 rtoy Rel $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1168,8 +1168,10 @@
 (define-info-class random-documentation)
 (define-info-type random-documentation stuff list ())
 
-;;; Used to record the source-location of definitions.
-;;;
+;;; Used to record the source-location of definitions.  Despite the
+;;; type name of "defvar", this holds the location information for
+;;; defvar, defparameter, and defconstant.  It also has the source
+;;; location for defstruct and deftype.
 (define-info-class source-location)
 (define-info-type source-location defvar (or form-numbers null) nil)
 
-- 
GitLab