* module/language/cps/dfg.scm (dead-after-use?): Don't kill a variable
if it was defined outside the current loop.
(dead-after-branch?): Likewise, but I don't think this helper is
correct yet :/
* module/language/cps/dfg.scm ($block): Add pdom and pdom-level fields,
for post-dominators.
(reverse-post-order, convert-predecessors): Arrange to work either
way: for dominators or for post-dominators.
(analyze-control-flow!): Compute post-dominators.
(dominates?): Refactor.
(post-dominates?): New helper.
* module/language/cps/dfg.scm ($block): Add "irreducible" field, format
TBD.
(reverse-post-order): Return a vector directly.
(convert-predecessors, compute-dom-levels, compute-idoms):
(analyze-control-flow!): Factor out control flow analsysis a bit
better.
(identify-loops): New helper. Currently a NOP.
(visit-fun): Adapt to compute-dominator-tree rename to
analyze-control-flow!.
* module/language/cps/dfg.scm (reverse-post-order, for-each/enumerate)
(convert-predecessors, finish-idoms, compute-dominator-tree): Compute
a dominator tree. We don't use it yet.
* module/language/cps/dfg.scm: Refactor so that we can think about
building a dominator tree. Split continuations out of use maps and
put them in a separate table, which will have more flow information.
(visit-fun): Mark clauses as using their bodies.
(lookup-predecessors, lookup-successors): New exports.
(find-defining-expression): Add an exception for clauses, now that
clauses are in the flow graph.
(continuation-bound-in?): Rename from variable-bound-in?, as it can
currently only be used for continuations.
* module/language/cps/contification.scm (contify): Adapt to use
lookup-predecessors and continuation-bound-in?.
* module/system/vm/assembler.scm (link-debug): If there was no debugging
info, reset the file register to 0 from its default value of 1 before
adding the final row.
* module/system/vm/dwarf.scm (line-prog-scan-to-pc): If we rescanned
from the beginning and still found no source info for this pc, return
#f instead of the default value of the file register (1).
* module/language/tree-il/peval.scm (peval): Fix a bug whereby inlined
function applications with default argument initializers were putting
the initializers in the wrong scope.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.
* libguile/frames.c (scm_frame_source, scm_frame_instruction_pointer):
Fix to work with RTL programs.
* module/system/vm/debug.scm (find-debug-context): Allow for the
possibility of there being no ELF image.
(find-program-debug-info, find-program-arities)
(program-minimum-arity, find-program-docstring)
(find-program-properties, find-source-for-addr)
(find-program-die, find-program-sources): Don't bail if we couldn't
get the debug context.
* module/system/vm/frame.scm (frame-next-source)
(frame-call-representation): Allow RTL programs.
* module/system/vm/program.scm (program-arguments-alist): Placeholder
implementation for RTL programs.
(program-arguments-alists): Don't bail if we couldn't get the
arities.
* module/language/cps/contification.scm (contify): Exhaustively replace
contified tail continuations, to fix a bug in nested tail-recursive
contifications. Likewise, call lookup-return-cont when searching for
common return continuations.
* module/language/cps/dfg.scm (variable-free-in?): Rename from
variable-used-in?, to match CWCC language.
(variable-bound-in?): New interface.
* module/language/cps/contification.scm (contify): Adapt caller. Add
more comments.
* module/system/vm/debug.scm (find-program-sources): If there is no
source location before the low-pc of the procedure we're grovelling
for, we were skipping the source loc info. Fix that.
* module/system/vm/program.scm (write-program): Get source info for
anonymous RTL functions.
(program-sources, program-sources-pre-retire): Provide program
counters relative to the beginning of the procedure.
* libguile/programs.c (scm_program_sources): Define as %program-sources,
and let Scheme export the program-sources proper.
(scm_program_source): Call out to Scheme.
* module/system/vm/program.scm: Convert to use match instead of pmatch.
Adapt existing callers.
(program-sources, program-source): New Scheme implementations of these
functions.
(program-sources-pre-retire): Add RTL program case.
* module/system/vm/debug.scm (<source>, source-pre-pc)
(source-post-pc, source-file, source-line, source-column)
(source-line-for-user): New data type for source location
information.
(find-source-for-addr, find-program-sources): New procedures to get
source location information for a particular address.
* module/system/vm/dwarf.scm (die-line-prog):
(line-prog-advance, line-prog-scan-to-pc): New public interfaces,
allowing clients to interpret the "statement programs" from
.debug_line DWARF sections.
(<meta>, elf->dwarf-context): Record the bounds of the .debug_line
section.
* module/web/client.scm (sanitize-request): Add a Content-Length
header if a body if given, even if the body is empty.
* module/web/server.scm (sanitize-response): Add a Content-Length
header if a body if given, even if the body is empty.
* module/srfi/srfi-9.scm: Add 2013 copyright date.
* test-suite/tests/srfi-9.test: Adapt to recent error reporting
improvements to procedures defined by 'define-tagged-inlinable'.
* module/ice-9/boot-9.scm (define-inlinable): Improve error reporting
when procedures defined using 'define-inlinable' are applied to the
wrong number of arguments.
* module/srfi/srfi-9.scm (define-tagged-inlinable): Improve error
reporting when procedures defined using 'define-tagged-inlinable' are
applied to the wrong number of arguments.
* module/language/tree-il/compile-cps.scm: New module implementing CPS
conversion of Tree-IL.
* module/Makefile.am:
* module/language/tree-il/spec.scm:
* module/language/cps/spec.scm: Integrate CPS in the build and language
system.
* module/scripts/disassemble.scm (disassemble): Update to work with
RTl (and only RTL, as that's the future).
* module/system/vm/debug.scm (for-each-elf-symbol): New public
interface.
(debug-context-from-image): New helper.
(find-debug-context): Use the helper.
* module/system/vm/disassembler.scm (disassemble-image): New public
interface.