Commit Graph

564 Commits

Author SHA1 Message Date
Christoffer Lerno
d2f046780d - Compiler crash using ?? with a void? macro #2973 2026-02-23 23:28:32 +01:00
Christoffer Lerno
585c66100d - Member access on a struct returned by the assignment expression, cause crash #2947 2026-02-19 20:43:45 +01:00
Christoffer Lerno
5d0c41da6b Refactor dylib name. 2026-02-16 01:21:05 +01:00
Christoffer Lerno
50718cb905 - Crash in slice expression when it contains a rethrow #2872
- Multiple issues when rethrowing inside of expressions #2873
2026-01-29 00:42:20 +01:00
Christoffer Lerno
414c0c9438 - Initializer did not correctly handle second rethrow #2870
- Crash encountering panic in if-else style switch #2871
2026-01-28 22:56:59 +01:00
Christoffer Lerno
362d5680e4 - Optional in initializer cause a crash #2864
- Negating a global address with offset was a counted as a global runtime constant #2865
- Converting static "make_slice" to array failed to be handled #2866
- Narrowing a not expression was incorrectly handled #2867
- Vector shift by optional scalar failed #2868
2026-01-28 21:59:40 +01:00
Christoffer Lerno
fed7a74a75 Fix assert in #2863 2026-01-28 19:02:27 +01:00
Christoffer Lerno
4fbb42833e - Crash when creating $Type* where $Type is an optional type #2848
- Crashes when using `io::EOF~!` in various unhandled places. #2848
2026-01-27 13:32:08 +01:00
Christoffer Lerno
3e76b7ff1c Fixes to optional rethrow in expressions. 2026-01-26 04:10:38 +01:00
Christoffer Lerno
a1ff3b05ed - Lowering of optional in && was incorrect #2843 2026-01-25 19:50:28 +01:00
Christoffer Lerno
8bd942c1b8 - Store of zero in lowering did not properly handle optionals in some cases #2837 2026-01-25 04:57:35 +01:00
Christoffer Lerno
0fdd6bdc81 - Early exit in macro call crashes codegen #2820 2026-01-25 00:52:57 +01:00
Christoffer Lerno
378b35265b - Raw vaargs with optional return not lowered correctly #2819 2026-01-24 23:54:20 +01:00
Christoffer Lerno
b5e25e3857 Constant deref of subscript had inserted checks #2818 2026-01-24 23:24:36 +01:00
Christoffer Lerno
cdabe8fd9e - Create optional with ~ instead of ?. return io::EOF?; becomes return io::EOF~.
- Deprecated use of `?` to create optional.
2026-01-20 16:10:28 +01:00
Christoffer Lerno
5390ca6250 - Eager evaluation of macro arguments would break inferred arrays on some platforms. #2771. 2026-01-20 13:02:14 +01:00
Christoffer Lerno
4512c6446d - Empty struct after @if processing was not detected, causing a crash instead of an error.
- Comparing an uint and int[<4>] was incorrectly assumed to be uint compared to int, causing a crash instead of an error.
- When an `int[*][6]` was given too few values, the compiler would assert instead of giving an error.
2026-01-19 15:01:08 +01:00
Christoffer Lerno
51364a9d1b Another fix in immediately rethrowing a value in an assignment #2689 2026-01-15 23:33:26 +01:00
Christoffer Lerno
4d93db51ee Check properly has use list. 2026-01-07 19:59:40 +01:00
Christoffer Lerno
067a4f7cb1 Fixed codegen for vec->array in the boolean case. 2026-01-01 00:25:32 +01:00
Christoffer Lerno
a2c886a2d9 - Compiler assert when passing returning CT failure immediately rethrown #2689. 2025-12-26 22:02:02 +01:00
Christoffer Lerno
f3b71ed7eb - $$MASK_TO_INT and $$INT_TO_MASK to create bool masks from integers and back.
- Fix bug when creating bool vectors in certain cases.
2025-12-25 20:55:11 +01:00
Christoffer Lerno
475816251b - Strings assigned to longer arrays would crash codegen, e.g. char[10] x = "abcd. 2025-12-12 20:35:11 +01:00
Christoffer Lerno
0b52819090 - Bug on rethrow in return with defer #2603. 2025-11-27 12:53:12 +01:00
Christoffer Lerno
8ec3a52ef7 - Add float[<3>] x = { .xy = 1.2, .z = 3.3 } swizzle initialization for vectors. #2599 2025-11-26 11:31:22 +01:00
Christoffer Lerno
a816a78e98 Fix alignment. 2025-11-20 12:09:38 +01:00
Christoffer Lerno
39694e65c0 - *(int*)1 incorrectly yielded an assert in LLVM IR lowering #2584. 2025-11-20 10:36:32 +01:00
Christoffer Lerno
4e66693065 - Refactored @simd implementation.
- Regression vector ABI: npot vectors would load incorrectly from pointers and other things. #2576
2025-11-16 01:37:39 +01:00
Christoffer Lerno
5070840da9 - Regression vector ABI: initializing a struct containing a NPOT vector with a constant value would crash LLVM. #2559 2025-11-04 01:04:07 +01:00
Christoffer Lerno
b3bce10699 Remove division-by-zero checks for floating point in safe mode #2556. 2025-11-03 02:43:01 +01:00
Christoffer Lerno
423152202f Dev (#2545)
* Optimize vector load / store. Fixes to alignment. Support typedef with `@simd` and `@align` #2543. Update vector ABI #2542
* Fix alignment issue with indirect arguments.
2025-10-25 12:31:06 +02:00
Christoffer Lerno
9cf271f5fb Refactoring codegen with Flat / Lowered types. Helpers for struct gep. type_get_indexed_type no longer returns the canonical type, fixes issues in #2534 2025-10-21 16:53:38 +02:00
Giuliano Macedo
614c6989d8 Fixed incorrect format strings when using error_exit. (#2530)
* Fixed incorrect format strings when using `error_exit`.
2025-10-20 11:24:07 +02:00
Christoffer Lerno
e37343fbe3 Refactor the C ABI conversion to use frontend independent types. 2025-10-14 19:38:51 +02:00
Christoffer Lerno
df67b7dddd Allow .. ranges to use "a..a-1" in order to express zero length. 2025-10-10 00:34:30 +02:00
Christoffer Lerno
0d85caf21c Add splat defaults for designated initialization #2441.
Add ??? and +++= to list-precedence.
2025-10-09 12:45:55 +02:00
Christoffer Lerno
44d736a537 Add +++= operator. 2025-09-25 14:48:00 +02:00
Christoffer Lerno
3ccabd625c Renaming 2025-09-22 23:08:11 +02:00
Christoffer Lerno
3345e70c63 Comparing slices and arrays of user-defined types that implement == operator now works #2486. 2025-09-19 11:21:29 +02:00
Christoffer Lerno
8035991ac3 ?? with void results on both sides cause a compiler crash #2472 2025-09-10 10:47:14 +02:00
Christoffer Lerno
69b3263a00 - Added path::home_directory, path::documents_directory, path::videos_directory, path::pictures_directory, path::desktop_directory, path::screenshots_directory,
`path::public_share_directory`, `path::templates_directory`, `path::saved_games_directory`, `path::music_directory`, `path::downloads_directory`.
  Fix codegen bug in expressions like `foo(x()) ?? io::EOF?` causing irregular crashes.
2025-09-06 02:27:10 +02:00
LowByteFox
6dbd81a6f9 add ability for TinyCC to compile c3c (#2459)
* add ability for TinyCC to compile c3c

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2025-09-06 01:47:48 +02:00
Christoffer Lerno
e605a21fd3 Revert "Revert 0.7.6 code for 0.7.5 re-release"
This reverts commit d1349c9cfb.
2025-09-05 23:30:35 +02:00
Christoffer Lerno
d1349c9cfb Revert 0.7.6 code for 0.7.5 re-release 2025-09-05 18:42:54 +02:00
niedlich
cf14787552 Typo fixes (#2457)
* fix typos in comments and strings
* fix typos in symbols (and some comments/strings)
* fix typos in releasenotes.md

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2025-09-04 01:07:07 +02:00
Christoffer Lerno
d291a40f69 Compiler hangs on == overload if other is generic #2443
Fix missing end of line when encountering errors in project creation.
2025-08-31 23:40:55 +02:00
Christoffer Lerno
cb006dd715 - Compiler module-scope pointer to slice with offset, causes assert. #2446 2025-08-31 23:18:27 +02:00
Christoffer Lerno
ca2fabc9f9 - $defined(#hash) will not check the internal expression, just that #hash exists.
- Added optional macro arguments using `macro foo(int x = ...)` which can be checked using `$defined(x)`.
- Supplemental `roundeven` has a normal implementation.
2025-08-29 11:23:39 +02:00
Christoffer Lerno
961aa0ef61 Struct and typedef subtypes inherit dynamic functions. 2025-08-23 22:31:29 +02:00
vssukharev
b7c9a4e2e9 Several fixes for the compiler (#2422)
* Update .gitignore for nix

* Fix build failure when compiling with -Werror=maybe-uninitialized

* Fix test failure formatting

* Add separateDebugInfo to c3c Nix build
2025-08-20 21:47:22 +02:00