diff options
| author | Tom Harley | 2020-01-11 22:55:19 +0000 |
|---|---|---|
| committer | Tom Harley | 2020-01-11 22:55:19 +0000 |
| commit | 9daf92178a175e2b40722d0becb732923fe262c5 (patch) | |
| tree | a0290a7a1dedf7b99b3a1798825710221556c40a /llvm_codegen.h | |
| parent | Rename compiler to sinc (diff) | |
| download | sinter-9daf92178a175e2b40722d0becb732923fe262c5.tar.gz sinter-9daf92178a175e2b40722d0becb732923fe262c5.zip | |
Make tail recursion mod cons toggleable
The tail recursion mod cons optimisation must now be enabled explicitly using -O tail-recursion-mod-cons.
Diffstat (limited to 'llvm_codegen.h')
| -rw-r--r-- | llvm_codegen.h | 11 |
1 files changed, 8 insertions, 3 deletions
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 <stdbool.h> + #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 */ |
