Christoffer Lerno
04c3efc3c3
Update assert for WASM
2021-12-20 00:32:27 +01:00
Christoffer Lerno
4b3232ead6
Some initial wasm support.
2021-12-19 12:18:43 +01:00
Christoffer Lerno
572aafe8b9
Remove use of LLVMBuildCall
2021-12-17 15:45:09 +01:00
Christoffer Lerno
1bb9c2d249
Allow the compiler to be called multiple times (while leaking)
2021-12-02 22:50:38 +01:00
Christoffer Lerno
e31d189837
Fix of issue of with generic typedefs.
2021-12-01 16:24:59 +01:00
Christoffer Lerno
aa7da00323
Support for ranged case.
2021-11-30 15:35:56 +01:00
Christoffer Lerno
3242bcabc0
Do-while uses for codegen and somewhat smaller llvm codegen
2021-11-28 01:35:09 +01:00
Christoffer Lerno
164a1ef59d
Initial foreach implementation based on index
2021-11-27 00:57:27 +01:00
Christoffer Lerno
1ba03f75c2
Fix debug parameter definition. Array foreach GEP.
2021-11-22 21:03:00 +01:00
Christoffer Lerno
7595f2e17b
Fix of incorrect visibility. Use of LLVMInstructionRemoveFromParent.
2021-11-22 14:14:07 +01:00
Christoffer Lerno
05c9b7cb33
More explicit conversion and width changes to some field.
2021-11-21 23:37:54 +01:00
Christoffer Lerno
8cc8c321a2
Optimized rethrow expr. Fix to "Foo! x = {}" which would break. Remove unnecessary zeroing failables. Variables that are undefined do not have failable status zeroed.
2021-11-19 13:06:43 +01:00
Christoffer Lerno
4d4bbbdebc
Parses attribute defines. Removal of incremental array parsing. Labels in macros should now work correctly. Volatile and attribute are no longer keywords. Checked a few todos. On test failure, return -1
2021-11-18 20:36:45 +01:00
Christoffer Lerno
7b04e7cf85
Added experimental "scoping" and fixed (simple) debug symbols
2021-11-17 23:56:09 +01:00
Christoffer Lerno
7bd76c973c
Placeholders for builtins. Updated character literal parsing, supporting 1-16 characters. More test cases.
2021-11-12 10:13:15 +01:00
Christoffer Lerno
4f09b0c351
Bitstruct implementation.
2021-11-05 11:59:30 +01:00
Christoffer Lerno
29e7af843a
Remove old try-catch. Top down promotion for binary etc. Prevent non-simple widening. Introducing wildcard failable. Move LLVM GEP usage. Regcall test and fix. Optimized slice assign.
2021-10-26 18:40:41 +02:00
Christoffer Lerno
9942be54dc
More optimized memclear. Added helper function on array gep.
2021-10-21 23:37:14 +02:00
Christoffer Lerno
4ca7ba048b
Updated to use ?, ?? and !! instead of !!, else and "else $unreachable"
2021-10-20 23:27:13 +02:00
Christoffer Lerno
b4df56db54
Removed original_type, pure, removed bigint, added i128 type, lots of fixes to $Foo, reassigning ct type, catch/macro, "!", removed type inference.
2021-10-19 10:39:02 +02:00
Christoffer Lerno
e4c7dde30b
Fix of shadowing bug. Allow pointer and subarrays to be constant initialized. Compile time values may now pass around anything considered compile time constant. It's possible to index into an initializer list at compile time. (Some work still remains on this)
2021-09-18 01:13:42 +02:00
Christoffer Lerno
29b3535460
Added fannkuch example.
2021-09-10 09:20:27 +02:00
Christoffer Lerno
73ce1017e8
Support LLVM 13+
2021-08-31 22:39:01 +02:00
Christoffer Lerno
63cff727b2
Removed use of ?:
2021-08-31 22:24:30 +02:00
Christoffer Lerno
8731634f4d
Unified constants (enum, error types, typeid). Removed EXPR_MEMBER_ACCESS. Added if-catch-switch. switch-case can handle non constant values. Inlining removed on O0. Added subarray comparison allowing string cases.
2021-08-27 19:13:32 +02:00
Christoffer Lerno
1751e7ece5
Remove old try/catch. Remove incorrect flattening. Basic asm. Start work on if-catch-switch.
2021-08-24 12:41:20 +02:00
Christoffer Lerno
f180a0d44a
Change anyerror { i64, i64 } -> i64. Cleaned up platform data and max tls / vector align. Initial work on bitstruct (just parsing). Updated try / catch semantics.
2021-08-18 17:31:09 +02:00
Christoffer Lerno
bc4ed2b213
Use assert functions on various platforms.
2021-08-16 16:43:53 +02:00
Christoffer Lerno
da76777ee4
Fixes to aarch64 float struct return. Missing byval and align on calls. This *breaks* try-catch.
2021-08-11 19:17:45 +02:00
Christoffer Lerno
f64c35214e
Change error -> anyerr / errtype
2021-07-18 14:11:39 +02:00
Christoffer Lerno
069dbe8238
Make it possible for globals and static variables to have failables.
2021-07-18 12:39:08 +02:00
Christoffer Lerno
22fb7b4bcc
Fix bug in (x && y && z) codegen.
2021-07-16 11:18:33 +02:00
Christoffer Lerno
a5ce7c47ba
Adding "require" precondition. Corrects inferred arrays and fixes so that it uses [*] everywhere. Distict type will now allow methods to be added to it. Added $alignof and $sizeof.
2021-07-09 23:57:35 +02:00
Christoffer Lerno
4ed2596164
Removes "yield"
2021-06-28 00:19:46 +02:00
Christoffer Lerno
038ed7f9d5
Macro methods added.
2021-06-26 17:42:45 +02:00
Christoffer Lerno
5a6cdd25ef
Introduced ${...} syntax for constants. Fixed issue where constants were not correctly handled for macros. /* */ comments are nesting. Added LINE, FUNC, FILE defines. Corrected shallow resolution of subarrays. Added int defines. Removed Vararray.
2021-06-24 00:59:25 +02:00
Christoffer Lerno
dafe0e6fb6
Updated scope code and variable tracking. Added trailing body macros.
2021-06-10 15:06:12 +02:00
Christoffer Lerno
dd8b850544
Support for "static" keyword.
2021-05-30 16:30:16 +02:00
Christoffer Lerno
3c4233f4d4
Fixes to failable return from expression and macro blocks. Allow division by float zero. Correct type promotion from compile time float.
2021-05-17 21:17:46 +02:00
Christoffer Lerno
f7919edb35
Split modules into generic and normal modules on the top level. Prepare for static. Change local -> static as keyword. Add private include. Remove old sub module search.
2021-05-09 19:26:05 +02:00
Christoffer Lerno
c6f671a6ca
A bit more global...
2021-04-29 22:44:00 +02:00
Christoffer Lerno
4210f1ccb2
Some work on vararray. Fix span on post unary. Updated error recovery. Updated return analysis to handle void functions. "while" now disallows error prone next line statement. Working on auto linking. Failable load optimized. Optimization and corrections for call returns + documentation.
2021-04-05 23:34:40 +02:00
Christoffer Lerno
4f064e7da2
Initial checkin of docs parsing. char is now unsigned, and signed char is "ichar".
2021-01-29 18:46:17 +01:00
Christoffer Lerno
45c4f205bb
More correct alignment. Foreach added. Removed dynamic designated array initialization. Use 16 byte alignment on arrays >= 16 for x64
2021-01-27 00:14:16 +01:00
Christoffer Lerno
7fc12192f4
Added "distinct" types.
2021-01-24 21:10:57 +01:00
Christoffer Lerno
3a24fbfa6d
Moved examples around. Updated (and corrected) const initialization. Removed "in" keyword. Added "member" attribute domain. Many fixes in struct padding and alignment and tests. Fixed extern global.
2021-01-24 00:55:09 +01:00
Christoffer Lerno
4da36dfed9
Optimized and improved aggregate initialization. Compound literal updated to Foo({ 1, 2 })-style. ".name = x" style initialization for named arguments and designated initializers. Added runtime messages on panics. subarrays convert implictly to pointers. len/len() functions. Fix taking slice of pointer. Vararg fixes
...
Consistent length typedef.
First stab at initializers.
Change compound literal to Foo({ 1, 2 }) style.
Fixed up some tests.
Optimize the zero struct codegen.
Optimize union empty initializer.
Fix issues with unions. Added alignment to globals. Added some union tests.
Use puts to emit error messages during runtime. Fixup of int[] -> int* style conversions.
Fix implicit conversion of int[3]* -> int*
Fix int[] size. Use () to invoke the length of a subarray. Fix taking a slice of a pointer. Limit the number of members in a struct.
Fixes to vararg using debug and cleanups to slices.
2020-12-22 21:55:52 +01:00
Christoffer Lerno
6a5a0f2b94
Moved ABI lowering from codegen to semantic analysis. Fixes for failables in the ABI and the codegen.
2020-12-04 19:19:57 +01:00
Christoffer Lerno
31e9ec3d52
Optimize load of return & some parameter types. Fix issue with non-exapanding coerce. Add support for specific arch_os in tests.
2020-11-24 20:31:18 +01:00
Christoffer Lerno
3c15e495dd
Add macro arguments &foo $foo #foo.
...
C ABI compatibility aarch64, win64, x86, x64
Added debug info
2020-11-22 22:16:19 +01:00