From 1a28889caf9bde44ce60ee40edc4ea78a94316c3 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 4 Apr 2017 08:14:39 +0000 Subject: [PATCH] Emit inline functions as primitives --- scheme/cyclone/cgen.sld | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index 362c031d..7d34484a 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -547,7 +547,14 @@ ;; c-compile-prim : prim-exp -> string -> string (define (c-compile-prim p cont) - (let* ((c-func (prim->c-func p)) + (let* ((c-func + (if (prim:udf? p) + (string-append + "((inline_function_type) + ((closure)" + (cgen:mangle-global p) + ")->fn)") + (prim->c-func p))) ;; Following closure defs are only used for prim:cont? to ;; create a new closure for the continuation, if needed. ;;