Remove $void CPS expression type
[bpt/guile.git] / module / language / cps / specialize-primcalls.scm
index e03eb62..cb5a70d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; Continuation-passing style (CPS) intermediate language (IL)
 
-;; Copyright (C) 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc.
 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -73,7 +73,7 @@
               ($letk ((k* ($kargs ('val) (val)
                             ($continue k src ($primcall 'values (val)))))
                       (kvoid ($kargs () ()
-                               ($continue k* src ($void)))))
+                               ($continue k* src ($const *unspecified*)))))
                 ($continue kvoid src exp)))))
         (define-syntax-rule (adapt-val exp)
           (let-fresh (k*) (val)
           (('struct-ref s (? immediate-u8? n))
            (adapt-val ($primcall 'struct-ref/immediate (s n))))
           (('struct-set! s (? immediate-u8? n) x)
-           ;; Unhappily, and undocumentedly, struct-set! returns the value
-           ;; that was set.  There is code that relies on this.  Hackety
-           ;; hack...
-           (let-fresh (k*) ()
-             (build-cps-term
-               ($letk ((k* ($kargs () ()
-                             ($continue k src ($primcall 'values (x))))))
-                 ($continue k* src ($primcall 'struct-set!/immediate (s n x)))))))
+           (build-cps-term
+             ($continue k src ($primcall 'struct-set!/immediate (s n x)))))
           (_ 
            (build-cps-term ($continue k src ($primcall name args))))))