From c4c22cfad83428c3f9e56fd3fbc21fe69e10fe34 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 6 Jun 2018 13:10:24 -0400 Subject: [PATCH] WIP --- scheme/cyclone/cgen.sld | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index 2ab5741b..6a03c287 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -716,6 +716,29 @@ (let* ((args (app->args exp)) (fun (app->fun exp))) (cond + ((and (pair? trace) + (not (null? (cdr trace))) + (adbv:direct-rec-call? (adb:get (cdr trace))) + TODO: what to put here? only want this for the direct rec calls... + (equal? (car exp) (cdr trace)) + ) + (let* ((cgen + (c-compile-args + args + append-preamble + "" + "" ;;this-cont + trace + cps?))) + (c-code + (string-append + ;(c:allocs->str (c:allocs cgen)) + "\n" + (c:body cgen) ;; TODO: re-assign function args, longer-term using temp variables + "\n" + "goto loop;"))) + ) + ((lambda? fun) (let* ((lid (allocate-lambda (c-compile-lambda fun trace #t))) ;; TODO: pass in free vars? may be needed to track closures ;; properly, wait until this comes up in an example