From 113e0d740bf435726ffcca80f919d606557a1f0d Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 18 May 2016 22:42:29 -0400 Subject: [PATCH] Bug fixes, explicitly handle const's --- scheme/cyclone/cps-optimizations.sld | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scheme/cyclone/cps-optimizations.sld b/scheme/cyclone/cps-optimizations.sld index 918fde9e..101ddf74 100644 --- a/scheme/cyclone/cps-optimizations.sld +++ b/scheme/cyclone/cps-optimizations.sld @@ -104,6 +104,8 @@ (lambda (expr) (analyze expr id)) (ast:lambda-body exp)))) + ((const? exp) #f) + ((quote? exp) #f) ((ref? exp) (let ((var (adb:get/default exp (adb:make-var)))) (adbv:set-ref-by! var (cons lid (adbv:ref-by var))) @@ -127,9 +129,10 @@ ; Application: ((app? exp) - (map (lambda (e) - (analyze e lid)) - exp)) + (for-each + (lambda (e) + (analyze e lid)) + exp)) ;TODO ((app? exp) (map (lambda (e) (wrap-mutables e globals)) exp)) ; Nothing to analyze for these? @@ -153,6 +156,8 @@ (lambda (expr) (analyze2 expr)) (ast:lambda-body exp)))) + ((const? exp) #f) + ((quote? exp) #f) ;; TODO: ; ((ref? exp) ; (let ((var (adb:get/default exp (adb:make-var)))) @@ -169,7 +174,7 @@ ,(analyze2 (if->else exp)))) ; Application: ((app? exp) - (map (lambda (e) (analyze2 e)) exp)) + (for-each (lambda (e) (analyze2 e)) exp)) (else #f))) ;; TODO: make another pass for simple lambda's