From 9daf92178a175e2b40722d0becb732923fe262c5 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Sat, 11 Jan 2020 22:55:19 +0000 Subject: Make tail recursion mod cons toggleable The tail recursion mod cons optimisation must now be enabled explicitly using `-O tail-recursion-mod-cons`. --- llvm_codegen.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'llvm_codegen.h') diff --git a/llvm_codegen.h b/llvm_codegen.h index 5e30b18..39624db 100644 --- a/llvm_codegen.h +++ b/llvm_codegen.h @@ -1,6 +1,8 @@ #ifndef LLVM_CODEGEN_H #define LLVM_CODEGEN_H +#include + #include "sinc.h" typedef enum { @@ -9,11 +11,14 @@ typedef enum { SMART_BOX } boxing_rule_t; -void llvm_codegen_prologue(char *filename, boxing_rule_t boxing_rule, uint - default_bit_width); +typedef struct { + boxing_rule_t boxing_rule; + uint default_bit_width; + bool tail_recursive_mod_cons; +} optimisation_t; +void llvm_codegen_prologue(char *filename, optimisation_t *optimisations); void llvm_codegen(sexpr *ast); - int llvm_codegen_epilogue(char *output_filename, format_t format); #endif /* LLVM_CODEGEN_H */ -- cgit v1.2.1