20030 Commits
Author SHA1 Message Date
gingerBill 55044ce40a Merge pull request #7884 from wintermi/fix-switch-range-bound-types
Give switch range bounds the type of the switch tag
2026-10-11 19:39:18 +01:00
gingerBill af81533ba8 Merge pull request #7886 from odin-lang/bill/compiler-type-refactor
Reduce `Type` and Polymorphic instantiation Memory Usage in the Checker
2026-10-11 17:37:03 +01:00
gingerBill 52b18c787e Look up polymorphic procedure instantiations by their operands before checking the signature 2026-10-11 17:18:38 +01:00
gingerBill f07c941cf5 Check procedure group candidates once, binding their polymorphic parameters with errors muted 2026-10-11 16:45:27 +01:00
gingerBill 357cb6873a Only re-check a polymorphic procedure's signature after a probe 2026-10-11 16:41:14 +01:00
Jeroen van Rijn 7e2e348b4b Merge pull request #7883 from corleypc/strconv-fast-float-swar
Moves SWAR floats parsing behind the STRCONV_FAST_FLOAT #config
2026-10-11 07:57:12 -07:00
Matthew Winter 4dad4ef64c Give switch range bounds the type of the switch tag
The bounds of a `switch` range case were checked against the tag but
never converted to its type, unlike a single case value, so untyped
bounds took their own default type. Against a `cstring` tag `"0"..="9"`
became `string` bounds, and converting a constant `string` to `cstring`
in the backend crashed the compiler. A `cstring16` or `string16` tag
failed with an invalid conversion from `string` instead. Convert the
bounds to the tag's type, which also gives an invalid bound the same
error as a single case value.

A constant `cstring` or `cstring16` tag forced the `string` comparison
procedures rather than its own, so it failed with a missing
`cstring_le` or `cstring16_le` even with typed bounds.

`lb_get_const_string` expected the data pointer of a constant string to
be a zero index GEP, which LLVM folds to the global itself, and it is
null for an empty string, so it read an invalid constant expression.
Handle both, and have a converted empty string point to its terminator
like a constant `cstring` rather than be nil.

Fixes #7853
2026-10-12 01:31:42 +11:00
corley 34ef8a435e puts swar floats parsing behind the STRCONV_FAST_FLOAT #config 2026-10-11 17:20:58 +03:00
gingerBill 9a66f5b9e0 Allocate only each Type kind's variant and cache ^T on T 2026-10-11 14:39:29 +01:00
gingerBill ed105e8029 Merge pull request #7880 from odin-lang/bill/newer-llvm-c-22-api
Use newer LLVM C API where it helps; exact float constants
2026-10-11 13:46:12 +01:00
gingerBill 4a3e528487 Revert exact signed division for ptr_sub 2026-10-11 13:38:30 +01:00
gingerBill 350d4f8074 Use an exact signed division for ptr_sub 2026-10-11 13:32:50 +01:00
gingerBill bbd289ce6b Keep signalling NaN constants signalling from 0h literals through to codegen 2026-10-11 12:39:21 +01:00
gingerBill 22187174ed Exact endian-swapped float constants; LLVMConstDataArray for string array constants on LLVM 21+ 2026-10-11 12:21:21 +01:00
gingerBill 87356ca7cc Merge pull request #7879 from corleypc/packed-field-zero-fix
Fixes alignment of #packed field zero stores
2026-10-11 12:07:07 +01:00
gingerBill 821f4283ea Merge pull request #7878 from odin-lang/bill/windows-update-llvm-22.1.8
Update Windows' version of LLVM to 22.1.8
2026-10-11 12:04:11 +01:00
corley 5125ce83d4 fixes packed field zeroing alignment 2026-10-11 13:46:55 +03:00
gingerBill 64f3934c59 Update Windows' version of LLVM to 22.1.8 2026-10-11 11:38:24 +01:00
gingerBill 9672dca06d Fallback to the pre-split bounds check handlers when the runtime lacks the new ones 2026-10-11 10:36:15 +01:00
gingerBill 0f991097d8 Print the missing runtime procedure's name in lb_lookup_runtime_procedure 2026-10-11 10:31:16 +01:00
gingerBill 19940a18b8 Merge pull request #7734 from nvkgbr/master
Fix quaternion RotateVector and InvRotateVector math in box3d_math
2026-10-11 10:22:19 +01:00
gingerBill 0d3a7f1a1c Minor style fix 2026-10-11 10:21:24 +01:00
gingerBill ff3906ed1a Merge pull request #7872 from gco-bmx/bugfix_named_union_with_alias
fix complier error from alias of named union
2026-10-11 10:20:50 +01:00
gingerBill 5fa33214ca Merge pull request #7874 from wintermi/fix/7862-separate-modules-name-race
Publish the backend's entity names atomically so parallel modules never read a half-written name
2026-10-11 10:20:23 +01:00
gingerBill 908b31f8d9 Merge pull request #7877 from odin-lang/bill/more-type-inference
More Type Inference Improvements
2026-10-11 09:55:20 +01:00
gingerBill e10e023120 Merge pull request #7876 from odin-lang/bill/semantics-fixes
General fixes in the odin parser to improve `-export-semantics`
2026-10-11 09:43:33 +01:00
gingerBill abf562870f Merge pull request #7865 from corleypc/array-conv-align-fix
Fixes array loads alignment in conversions and matrix-vec multiplication
2026-10-11 09:41:04 +01:00
gingerBill 4f9fc217b5 Report the blocks left unclosed at a declaration once 2026-10-11 09:36:55 +01:00
gingerBill 17d23d9d9e Merge pull request #7871 from odin-lang/bill/semantics-fixes
Record the enum field an implicit selector picks in `-export-semantics`
2026-10-11 09:35:57 +01:00
gingerBill 96a63a279a Treat a declaration starting a line in a procedure as unindented when a later } closes a block it is in 2026-10-11 09:34:37 +01:00
Matthew Winter 3c6fe188dd Publish the backend's entity names atomically so parallel modules never read a half-written name
With `-use-separate-modules`, modules are generated on parallel threads and
name the same entities (e.g. a struct from a shared package) at the same time.
`lb_get_entity_name` cached the name by writing plain `String` fields on the
shared `Entity` (`TypeName.ir_mangled_name`, `Procedure.link_name` and
`Variable.link_name`), so another thread could read a non-zero `len` with a
null or partially written `text` and crash in `alloc_cstring`.

Cache the name in an `std::atomic<String *>` on `Entity` published with a
compare-exchange, as `lb_local_proc_name` already does, and stop writing the
name back into `link_name`, which other threads also read whilst
canonicalizing names. `link_name` now only ever holds the checker's name.

Fixes #7862
2026-10-11 14:23:18 +11:00
gco b4d08925f2 fix complier error from alias of named union
example
```odin
Scope :: any_dec

any_dec :: union {
  ^type_incomplete_declaration,
  ^type_enum_declaration,
  ...

sym_scope :: struct {
  syms : map[StrHandle][dynamic]symbol,
  parent_scope : Scope,
}

sym_scope_make :: proc(parent : Scope, alloc : mem.Allocator) -> sym_scope {
  return sym_scope{make(map[StrHandle][dynamic]symbol, 0, alloc), parent} ---sometimes error here
}
```
depending on where the alias was declared, can output
```
Error: Cannot assign value 'parent' of type 'any_dec' to 'union {^type_incomplete_declaration, ...}' in a structure literal
        ... sym_scope{make(map[StrHandle][dynamic]symbol, 0, alloc), parent}
```

haven't been able to recreate a minimal reproduceable test case yet
2026-10-11 11:00:05 +11:00
gingerBill b88946474e Test that an implicit selector's use in -export-semantics is the field of the picked procedure's enum 2026-10-10 23:36:34 +01:00
gingerBill 2382daf248 Record the enum field an implicit selector picks in -export-semantics 2026-10-10 23:33:45 +01:00
Jeroen van Rijn ed63154d8c Merge pull request #7870 from michtesar/7771/math-big-int-destruction-fix
Fix core:math/big integer destruction
2026-10-10 14:54:21 -07:00
Michael Tesař daa6393388 Fix core:math/big integer destruction 2026-10-10 23:38:53 +02:00
gingerBill 4b9ec2aa03 Determine a polymorphic record parameter's types from the fields of an untyped compound literal argument 2026-10-10 19:37:43 +01:00
gingerBill a88548cb6a Bind a $T whose argument has no definite type from the leftmost argument with one without changing which procedure group member a call picks 2026-10-10 19:15:04 +01:00
corley ec4a09331d fixes array alignment in conversions and matrix-array multiplication 2026-10-10 20:52:05 +03:00
gingerBill d3eeb87cad Let .X take the element type of a fixed array type hint broadcasting it like an untyped constant 2026-10-10 18:50:22 +01:00
gingerBill 3ec16d8875 Merge pull request #7724 from odin-lang/bill/fix-pads-to-be-c-like
BREAKING CHANGE: Make `fmt` pad widths with spaces unless the `0` flag is given, keeping to C-style `printf` rules
2026-10-10 18:46:40 +01:00
gingerBill 8312c126a5 Defer &{...} arguments like {...}; reject procedure group members whose deferred argument does not fit; stop muted warnings failing trial checks 2026-10-10 18:42:42 +01:00
gingerBill 265a56b6b4 Infer an untyped {...} or .X from the other operand of binary expressions, for ranges, and min/max/clamp 2026-10-10 18:29:26 +01:00
gingerBill 941cc1c98c Merge pull request #7860 from odin-lang/bill/sync-chan-improvements
`core:sync/chan`: lock-free buffered channels, unbuffered handoff, timeouts
2026-10-10 17:48:18 +01:00
gingerBill 23086cebd7 Stop Darwin futex wakes retrying forever on EFAULT, and fix sub-microsecond and long timeouts before macOS 11 2026-10-10 17:38:59 +01:00
gingerBill 705d4e6575 Handle interrupted and raced waits in the BSD futex wrappers and use private umtx operations on FreeBSD 2026-10-10 17:32:58 +01:00
gingerBill 8b35c86efb Fix crash assigning nil or --- to an array of any 2026-10-10 17:31:54 +01:00
gingerBill ff5843b171 Allow nil to broadcast to an array of unions again 2026-10-10 17:02:56 +01:00
gingerBill 2e29cf5afe Make core:sync/chan is_closed agree with send/recv on buffered channels 2026-10-10 16:56:14 +01:00
gingerBill 25df975785 Give the instantiations of a generic procedure the generic's type in -export-semantics 2026-10-10 16:52:56 +01:00