diff options
author | Andy Wingo <wingo@pobox.com> | 2009-01-30 11:41:02 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-01-30 11:41:02 +0100 |
commit | 5d6fb8bbeb5a6ab423062da3744ca215b0310dc2 (patch) | |
tree | 128189158c6fab48f2e2595129b0c4fc67484496 /module/system/base/compile.scm | |
parent | 4b3184828416acfa5c099a54954ca00ce3cc0d0d (diff) | |
download | guile-5d6fb8bbeb5a6ab423062da3744ca215b0310dc2.tar.gz |
allow specification of languages by name; add decompilers to languages
* module/system/base/language.scm (lookup-decompilation-order): New
function, like its compiling cousin, but backwards.
(compute-translation-order): Rework so that languages can be specified
either by name or by identity. Return a list of language - procedure
pairs, without the "to" language in the list, instead of a list of
languages.
(invalidate-compilation-cache!): Invalidate the decompilation cache
too.
(<language>): Add a decompiler field.
* module/system/base/compile.scm (compile-passes): Much simpler now that
lookup-compilation-order gives us the procedures directly.
* module/language/*/spec.scm: Specify compilers by name, so that we can
avoid unnecessary module loads, and so that when we specify
decompilers, we can avoid cycles.
Diffstat (limited to 'module/system/base/compile.scm')
-rw-r--r-- | module/system/base/compile.scm | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm index 4f1546025..4cc04cd03 100644 --- a/module/system/base/compile.scm +++ b/module/system/base/compile.scm @@ -140,15 +140,9 @@ (error "language has no #:read-file" lang)))) (define (compile-passes from to opts) - (let lp ((langs (or (lookup-compilation-order from to) - (error "no way to compile" (language-name from) - "to" (language-name to)))) - (out '())) - (if (null? (cdr langs)) - (reverse! out) - (lp (cdr langs) - (cons (assq-ref (language-compilers (car langs)) (cadr langs)) - out))))) + (map cdr + (or (lookup-compilation-order from to) + (error "no way to compile" from "to" to)))) (define (compile-fold passes exp env opts) (if (null? passes) |