summaryrefslogtreecommitdiff
path: root/llvm_codegen.c
AgeCommit message (Collapse)AuthorLines
2023-02-01Return correctly when checking TRMD of string litTom Harley-0/+1
When trying to determine if an expression is tail-recursive, this should not error in the case that the expression is a string literal.
2022-08-26Upgrade to LLVM 14Tom Harley-6/+23
Adding attributes to functions/values has been broken by the upgrade. Additionally, the debug builder wants more information which is currently not being provided.
2022-08-26Correct indentation of case statementmasterTom Harley-2/+2
2022-05-11Fix issue with nested case statementsTom Harley-2/+18
Previously, nested case statements would cause phis to be given incorrect incoming blocks, causing issues when compiling the LLVMIR with clang. To fix this, all case branches are given a second "exit" block that they jump to before jumping to the phi block. This way, we always know the block that was just left to get to the phi.
2022-05-04Add String supportTom Harley-2/+37
escape slashes still need to be supported though!
2022-02-09Add support for "case" statementsHEADtrh/submissionTom Harley-6/+81
Both this feature and "let" statements (committed previously) require documentation.
2022-01-27Add support for "let" statementsTom Harley-1/+49
2020-01-12Add some LLVM attributes to functionsTom Harley-10/+54
Some of the functions generated by sinc can have attributes added to them that might be difficult for the LLVM toolchain to infer. Attribute generation can be turned off with `-O no-llvm-attributes`.
2020-01-11Make tail recursion mod cons toggleableTom Harley-23/+29
The tail recursion mod cons optimisation must now be enabled explicitly using `-O tail-recursion-mod-cons`.
2020-01-11Rename compiler to sincTom Harley-1/+1
2020-01-11Added int width specifiersTom Harley-119/+116
The width of an int can be specified at the site of its creation. For example, the following function returns an int of width 2 bits and value 1: [def two_bit_int [] (2 1)] Ints can still be written the old way; in these cases the compiler looks for a default int bit-width (specified with the -w flag). If a default has not been defined, the compiler throws an error.
2020-01-08Add option to enable/disable boxingTom Harley-30/+131
Only affects atomic types, not structs. Accepts three options: - "-u always": always boxes - "-u never": never boxes - "-u smart": inserts a comparison of sizes, and boxes only if the item is bigger than a pointer. "smart" is smart in name only; I expected the comparison to be optimised away (since the sizes of the types are known at compile-time), but it seems to run significantly slower than the other options. Steps to improve: - try making the comparison compile-time (or, if it already is, find out why it's so slow);
2020-01-08I should commit moreTom Harley-100/+788
2019-12-23checkpointTom Harley-0/+842