Changeset 8836


Ignore:
Timestamp:
Mar 20, 2008, 7:40:22 PM (12 years ago)
Author:
mb
Message:

Extend compiler and fasloader to store, and set, toplevel source notes.

This allows functions, such as record-source-file, to get the
source-note for the current toplevel form. I'm not yet committing the
(essential) change to record-source-file. This tree can reliably build
itself and, if nothing else, starts up qres.

Location:
branches/working-0711/ccl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-0/l0-init.lisp

    r7887 r8836  
    129129
    130130(defparameter *loading-file-source-file* nil)
     131(defparameter *loading-toplevel-location* nil)
    131132
    132133(defvar *nx-speed* 1)
  • branches/working-0711/ccl/level-0/nfasload.lisp

    r8646 r8836  
    677677    ; (format t "~& source-file = ~s" source-file)
    678678    (setq *loading-file-source-file* source-file)))
     679
     680(deffaslop $fasl-toplevel-location (s)
     681  (%cant-epush s)
     682  (let* ((location (%fasl-expr s)))
     683    (setq *loading-toplevel-location* location)))
    679684
    680685(defvar *modules* nil)
  • branches/working-0711/ccl/level-1/l1-files.lisp

    r8813 r8836  
    11721172           (*readtable* *readtable*)
    11731173           (*loading-files* (cons file-name (specialv *loading-files*)))
    1174            (*loading-file-source-file* (namestring source-file))) ;reset by fasload to logical name stored in the file?
     1174           ;reset by fasload to logical name stored in the file?
     1175           (*loading-file-source-file* (namestring source-file))
     1176           ;set by the fasloader (rebinding here so concurrent %load will work
     1177           (*loading-toplevel-location* nil))
    11751178      (declare (special *loading-files* *loading-file-source-file*))
    11761179      (when verbose
  • branches/working-0711/ccl/level-1/l1-init.lisp

    r8554 r8836  
    260260(defparameter *save-definitions* t)
    261261(defparameter *save-local-symbols* t)
    262 (defparameter *save-source-locations* nil)
     262(defparameter *save-source-locations* t)
    263263
    264264(defvar *modules* nil
  • branches/working-0711/ccl/lib/nfcomp.lisp

    r8743 r8836  
    448448              (require-type *fcomp-source-being-compiled* 'null)
    449449              (return))
     450            (fcomp-output-form $fasl-toplevel-location env *fcomp-source-being-compiled*)
    450451            (fcomp-form form env processing-mode)
    451452            (setq *fcomp-previous-position* *fcomp-stream-position*))))
  • branches/working-0711/ccl/xdump/faslenv.lisp

    r8042 r8836  
    138138(defconstant $fasl-nvmksym 68)          ;<nvstring> Make a string
    139139(defconstant $fasl-nvstr 69)            ;<nvstring> Make an uninterned symbol
    140 
     140(defconstant $fasl-toplevel-location 70);<expr> - Set *loading-toplevel-location* to <expr>.
    141141
    142142;;; <string> means <size><size bytes> (this is no longer used)
  • branches/working-0711/ccl/xdump/xfasload.lisp

    r7908 r8836  
    350350(defparameter *xload-cold-load-documentation* nil)
    351351(defparameter *xload-loading-file-source-file* nil)
     352(defparameter *xload-loading-toplevel-location* nil)
    352353
    353354(defparameter *xload-pure-code-p* t)     ; when T, subprims are copied to readonly space
     
    891892             (*loading-files* (cons path *loading-files*))
    892893             (*xload-loading-file-source-file* nil)
     894             (*xload-loading-toplevel-location* nil)
    893895             (*loading-file-source-file* (namestring source-file)))
    894896        (when *load-verbose*
     
    997999         (*xload-cold-load-documentation* nil)
    9981000         (*xload-loading-file-source-file* nil)
     1001         (*xload-loading-toplevel-location* nil)
    9991002         (*xload-aliased-package-addresses* nil)
    10001003         (*xload-special-binding-indices*
     
    15301533
    15311534(defun xload-record-source-file (symaddr indicator)
     1535  ;; need to do something with *xload-loading-toplevel-location*
    15321536  (when *xload-record-source-file-p*
    15331537    (when (or (eq indicator 'function)
     
    16611665  (let* ((path (%fasl-expr s)))
    16621666    (setq *xload-loading-file-source-file* path)))
     1667
     1668(defxloadfaslop $fasl-toplevel-location (s)
     1669  (%cant-epush s)
     1670  (let* ((location (%fasl-expr s)))
     1671    (setq *xload-loading-toplevel-location* location)))
    16631672
    16641673(defxloadfaslop $fasl-clfun (s)
Note: See TracChangeset for help on using the changeset viewer.