diff options
author | Andy Wingo <wingo@pobox.com> | 2009-02-10 11:53:23 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-02-10 11:53:23 +0100 |
commit | 028e3d06665d4eb50b5d0f0d0101acc039c2ae68 (patch) | |
tree | e101393d98ca1fc67b724822bf0fb2e0d531aaf9 /libguile/programs.h | |
parent | dae318a63140ac7b1f396440bc341fea901be9b9 (diff) | |
download | guile-028e3d06665d4eb50b5d0f0d0101acc039c2ae68.tar.gz |
propagate much more source info through compilation
* module/language/ghil/compile-glil.scm (codegen): Record source location
for offset 0 into a lambda, if we can.
* module/language/scheme/compile-ghil.scm (translate-1)
(define-scheme-translator): In the retrans procedures, propagate the
location information from the enclosing expression if the subexpression
has no location information. Gives source information to many more
expressions.
(location): Just propagate the source properties as they are, the
glil->assembly compiler will interpret them.
* module/language/glil.scm (<glil>): Change glil-source to take "props"
and not "loc", as it's the source properties that we're interested in.
* module/language/glil/compile-assembly.scm (limn-sources): New function,
takes a list of addr-source property pairs and "compresses" them for
serialization to disk.
(glil->assembly): Limn the sources before writing them to disk. Avoid
non-tail recursion when determining total byte length of code.
* module/system/vm/program.scm (source:file, source:line, source:column):
Update for new source representation.
(program-source): Export.
(write-program): Nicer pretty-printing of anonymous procedures.
* libguile/backtrace.c (display_backtrace_get_file_line): Update for the
new VM source representation.
* libguile/programs.h:
* libguile/programs.c (scm_program_sources): Update for the new
serialized source representation, where the filename is not in the
stream unless it changes.
(scm_program_source): New exported function, looks up the source for a
given ip offset.
(scm_c_program_source): Update to return the last source information
that was <= the given IP, because we only serialize source info when it
changes.
Diffstat (limited to 'libguile/programs.h')
-rw-r--r-- | libguile/programs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libguile/programs.h b/libguile/programs.h index 263228bec..68a6936a2 100644 --- a/libguile/programs.h +++ b/libguile/programs.h @@ -71,6 +71,7 @@ extern SCM scm_program_arity (SCM program); extern SCM scm_program_meta (SCM program); extern SCM scm_program_bindings (SCM program); extern SCM scm_program_sources (SCM program); +extern SCM scm_program_source (SCM program, SCM ip); extern SCM scm_program_properties (SCM program); extern SCM scm_program_name (SCM program); extern SCM scm_program_objects (SCM program); |