From c10d38e170b16b8231987da242ccf84278812a93 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 24 Oct 2018 13:29:34 -0400 Subject: [PATCH] Support alloca of basic arithmetic operations --- scheme/cyclone/cgen.sld | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index dc90cc38..166e2c8a 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -692,12 +692,17 @@ (else ""))) (tdata-comma (if (> (string-length tdata) 0) "," "")) (tptr-type (prim/c-var-pointer p)) - (tptr-comma (if tptr-type ",&" "")) + (tptr-comma + (cond + ((and tptr-type use-alloca?) ",") + (tptr-type ",&") + (else ""))) (tptr (cond (tptr-type (mangle (gensym 'local))) (else ""))) (tptr-decl (cond + ((and tptr-type use-alloca?) (string-append "object " tptr " = alloca(sizeof(" tptr-type ")); ")) (tptr-type (string-append tptr-type " " tptr "; ")) (else ""))) (c-var-assign