1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 20:20:20 +02:00

tree-il-src is a vector, replaces tree-il-srcv

* module/language/tree-il.scm (tree-il-src): Always a vector now;
tree-il-srcv is gone.  An incompatible change but we are in the
compiler.
(location): For parse-tree-il, make vector locations instead of alists.
* module/language/tree-il/analyze.scm:
* module/language/tree-il/compile-bytecode.scm:
* module/language/tree-il/compile-cps.scm:
* module/language/tree-il/debug.scm:
* module/language/tree-il/letrectify.scm:
* module/language/tree-il/peval.scm:
* module/system/vm/assembler.scm: Update all uses to expect vectors
instead of alists and to use tree-il-src instead of tree-il-srcv.
* module/language/elisp/compile-tree-il.scm (location): Create vectors,
not alists.
* test-suite/tests/compiler.test ("psyntax"): Update syntax-source
expectation.
This commit is contained in:
Andy Wingo 2025-05-09 14:57:37 +02:00
parent f399f36d37
commit 9ab8f3d807
10 changed files with 39 additions and 57 deletions

View file

@ -582,7 +582,7 @@ N-byte unit."
;; A list of (pos . source) pairs, indicating source information. POS
;; is relative to the beginning of the text section, and SOURCE is in
;; the same format that source-properties returns.
;; the same format that syntax-sourcev returns.
;;
(sources asm-sources set-asm-sources!)
@ -2900,26 +2900,17 @@ procedure with label @var{rw-init}. @var{rw-init} may be false. If
(let lp ((sources (asm-sources asm)) (out '()))
(match sources
(((pc . location) . sources)
(let-values (((file line col)
;; Usually CPS records contain a "source
;; vector" coming from tree-il, but some might
;; contain a source property alist.
(match location
(#(file line col) (values file line col))
(lst (values (assq-ref lst 'filename)
(assq-ref lst 'line)
(assq-ref lst 'column))))))
(lp sources
;; Guile line and column numbers are 0-indexed, but
;; they are 1-indexed for DWARF.
(if (and line col)
(cons (list pc
(if (string? file) (intern-file file) 0)
(1+ line)
(1+ col))
out)
out))))
(((pc . #(file line col)) . sources)
(lp sources
;; Guile line and column numbers are 0-indexed, but
;; they are 1-indexed for DWARF.
(if (and line col)
(cons (list pc
(if (string? file) (intern-file file) 0)
(1+ line)
(1+ col))
out)
out)))
(()
;; Compilation unit header for .debug_line. We write in
;; DWARF 2 format because more tools understand it than DWARF