guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, wip-cps-bis, updated. v2.1.0-201-g67ee


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, wip-cps-bis, updated. v2.1.0-201-g67eec8d
Date: Sat, 17 Aug 2013 07:59:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=67eec8d4593b041debf63c9ccd793e6f372e2bcb

The branch, wip-cps-bis has been updated
       via  67eec8d4593b041debf63c9ccd793e6f372e2bcb (commit)
       via  6e331f8caaa2e37bedac2e2bbeeacd05cdcaab9a (commit)
      from  5b8e9697631af078ab217a2098522e09126321b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 67eec8d4593b041debf63c9ccd793e6f372e2bcb
Author: Mark H Weaver <address@hidden>
Date:   Sat Aug 17 03:57:44 2013 -0400

    RTL Compiler: use $letconst in init-closure.
    
    * module/language/cps/closure-conversion.scm (init-closure): Use
      $letconst.

commit 6e331f8caaa2e37bedac2e2bbeeacd05cdcaab9a
Author: Mark H Weaver <address@hidden>
Date:   Sat Aug 17 03:53:36 2013 -0400

    RTL Compiler: arrange for scheme-indent-functions to be eval'd by emacs.
    
    * module/language/cps.scm:
    * module/language/cps/arities.scm:
    * module/language/cps/closure-conversion.scm:
    * module/language/cps/reify-primitives.scm:
    * module/language/tree-il/compile-cps.scm: Add magic bits to the end
      of each file, setting scheme-indent-functions for the CPS-building
      macros.

-----------------------------------------------------------------------

Summary of changes:
 module/language/cps.scm                    |   33 +++++++++++++--------------
 module/language/cps/arities.scm            |    8 ++++++
 module/language/cps/closure-conversion.scm |   31 ++++++++++++++++++-------
 module/language/cps/reify-primitives.scm   |   16 +++++++++++++
 module/language/tree-il/compile-cps.scm    |   18 ++++++++++++--
 5 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/module/language/cps.scm b/module/language/cps.scm
index f0cf058..79fc8ad 100644
--- a/module/language/cps.scm
+++ b/module/language/cps.scm
@@ -136,20 +136,6 @@
 (define-cps-type $values args)
 (define-cps-type $prompt escape? tag handler)
 
-;; FIXME: Figure out how to evaluate this automatically when Emacs
-;; visits this buffer.
-;;
-;; (put 'let-gensyms 'scheme-indent-function 1)
-;; (put 'build-cps-term 'scheme-indent-function 0)
-;; (put 'build-cps-call 'scheme-indent-function 0)
-;; (put 'build-cps-cont 'scheme-indent-function 0)
-;; (put '$letk 'scheme-indent-function 1)
-;; (put '$letk* 'scheme-indent-function 1)
-;; (put '$letconst 'scheme-indent-function 1)
-;; (put '$continue 'scheme-indent-function 1)
-;; (put '$kargs 'scheme-indent-function 2)
-;; (put '$kentry 'scheme-indent-function 1)
-
 (define-syntax let-gensyms
   (syntax-rules ()
     ((_ (sym ...) body body* ...)
@@ -230,9 +216,6 @@
     ((_ ($continue k exp))
      (make-$continue k (build-cps-call exp)))))
 
-;; (put 'rewrite-cps-term 'scheme-indent-function 1)
-;; (put 'rewrite-cps-cont 'scheme-indent-function 1)
-;; (put 'rewrite-cps-call 'scheme-indent-function 1)
 (define-syntax-rule (rewrite-cps-term x (pat body) ...)
   (match x
     (pat (build-cps-term body)) ...))
@@ -407,3 +390,19 @@
       (($ $letrec names syms funs body) (term-folder body seed))))
 
   (cont-folder cont seed))
+
+;;; Local Variables:
+;;; eval: (put 'let-gensyms 'scheme-indent-function 1)
+;;; eval: (put 'build-cps-term 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-call 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-cont 'scheme-indent-function 0)
+;;; eval: (put 'rewrite-cps-term 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-cont 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-call 'scheme-indent-function 1)
+;;; eval: (put '$letk 'scheme-indent-function 1)
+;;; eval: (put '$letk* 'scheme-indent-function 1)
+;;; eval: (put '$letconst 'scheme-indent-function 1)
+;;; eval: (put '$continue 'scheme-indent-function 1)
+;;; eval: (put '$kargs 'scheme-indent-function 2)
+;;; eval: (put '$kentry 'scheme-indent-function 1)
+;;; End:
diff --git a/module/language/cps/arities.scm b/module/language/cps/arities.scm
index 85dcff1..ffe8ccc 100644
--- a/module/language/cps/arities.scm
+++ b/module/language/cps/arities.scm
@@ -147,3 +147,11 @@
   (rewrite-cps-call fun
     (($ $fun meta self free entries)
      ($fun meta self free ,(map fix-entry-arities entries)))))
+
+;;; Local Variables:
+;;; eval: (put 'let-gensyms 'scheme-indent-function 1)
+;;; eval: (put 'build-cps-term 'scheme-indent-function 0)
+;;; eval: (put '$letk 'scheme-indent-function 1)
+;;; eval: (put '$continue 'scheme-indent-function 1)
+;;; eval: (put '$kargs 'scheme-indent-function 2)
+;;; End:
diff --git a/module/language/cps/closure-conversion.scm 
b/module/language/cps/closure-conversion.scm
index ddf6e9f..1f4e9dd 100644
--- a/module/language/cps/closure-conversion.scm
+++ b/module/language/cps/closure-conversion.scm
@@ -78,20 +78,17 @@ values: the term and a list of additional free variables in 
the term."
 label of the outer procedure, where the initialization will be
 performed, and @var{outer-bound} is the list of bound variables there."
   (fold (lambda (free idx body)
-          (let-gensyms (k k* idxsym)
+          (let-gensyms (k idxsym)
             (build-cps-term
               ($letk ((k src ($kargs () () ,body)))
                 ,(convert-free-var
                   free outer-self outer-bound
                   (lambda (free)
-                    (values
-                     (build-cps-term
-                       ($letk ((k* src ($kargs ('idx) (idxsym)
-                                         ($continue k
-                                           ($primcall 'free-set!
-                                                      (v idxsym free))))))
-                         ($continue k* ($const idx))))
-                     '())))))))
+                    (values (build-cps-term
+                              ($letconst (('idx idxsym idx))
+                                ($continue k
+                                  ($primcall 'free-set! (v idxsym free)))))
+                            '())))))))
         body
         free
         (iota (length free))))
@@ -263,3 +260,19 @@ and allocate and initialize flat closures."
          (error "Expected no free vars in toplevel thunk" exp entries free))
        (build-cps-call
          ($fun meta self '() ,(map convert-to-indices entries)))))))
+
+;;; Local Variables:
+;;; eval: (put 'let-gensyms 'scheme-indent-function 1)
+;;; eval: (put 'build-cps-term 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-call 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-cont 'scheme-indent-function 0)
+;;; eval: (put 'rewrite-cps-term 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-cont 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-call 'scheme-indent-function 1)
+;;; eval: (put '$letk 'scheme-indent-function 1)
+;;; eval: (put '$letk* 'scheme-indent-function 1)
+;;; eval: (put '$letconst 'scheme-indent-function 1)
+;;; eval: (put '$continue 'scheme-indent-function 1)
+;;; eval: (put '$kargs 'scheme-indent-function 2)
+;;; eval: (put '$kentry 'scheme-indent-function 1)
+;;; End:
diff --git a/module/language/cps/reify-primitives.scm 
b/module/language/cps/reify-primitives.scm
index f3fdea7..a703194 100644
--- a/module/language/cps/reify-primitives.scm
+++ b/module/language/cps/reify-primitives.scm
@@ -96,3 +96,19 @@
             (_ term)))))
 
     (visit-fun fun)))
+
+;;; Local Variables:
+;;; eval: (put 'let-gensyms 'scheme-indent-function 1)
+;;; eval: (put 'build-cps-term 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-call 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-cont 'scheme-indent-function 0)
+;;; eval: (put 'rewrite-cps-term 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-cont 'scheme-indent-function 1)
+;;; eval: (put 'rewrite-cps-call 'scheme-indent-function 1)
+;;; eval: (put '$letk 'scheme-indent-function 1)
+;;; eval: (put '$letk* 'scheme-indent-function 1)
+;;; eval: (put '$letconst 'scheme-indent-function 1)
+;;; eval: (put '$continue 'scheme-indent-function 1)
+;;; eval: (put '$kargs 'scheme-indent-function 2)
+;;; eval: (put '$kentry 'scheme-indent-function 1)
+;;; End:
diff --git a/module/language/tree-il/compile-cps.scm 
b/module/language/tree-il/compile-cps.scm
index 180473c..82b1dd2 100644
--- a/module/language/tree-il/compile-cps.scm
+++ b/module/language/tree-il/compile-cps.scm
@@ -47,9 +47,6 @@
                  tree-il-fold))
   #:export (compile-cps))
 
-;; (put 'convert-arg 'scheme-indent-function 1)
-;; (put 'convert-args 'scheme-indent-function 1)
-
 ;; Guile's semantics are that a toplevel lambda captures a reference on
 ;; the current module, and that all contained lambdas use that module to
 ;; resolve toplevel variables.  This parameter tracks whether or not we
@@ -557,3 +554,18 @@ indicates that the replacement variable is in a box."
   (values (cps-convert/thunk (optimize-tree-il exp env opts))
           env
           env))
+
+;;; Local Variables:
+;;; eval: (put 'convert-arg 'scheme-indent-function 1)
+;;; eval: (put 'convert-args 'scheme-indent-function 1)
+;;; eval: (put 'let-gensyms 'scheme-indent-function 1)
+;;; eval: (put 'build-cps-term 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-call 'scheme-indent-function 0)
+;;; eval: (put 'build-cps-cont 'scheme-indent-function 0)
+;;; eval: (put '$letk 'scheme-indent-function 1)
+;;; eval: (put '$letk* 'scheme-indent-function 1)
+;;; eval: (put '$letconst 'scheme-indent-function 1)
+;;; eval: (put '$continue 'scheme-indent-function 1)
+;;; eval: (put '$kargs 'scheme-indent-function 2)
+;;; eval: (put '$kentry 'scheme-indent-function 1)
+;;; End:


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]