Commit Graph

5533 Commits

Author SHA1 Message Date
Laytan Laats
478c923e2c fix another type alias issue with mini cycle 2025-05-26 19:48:28 +02:00
Jeroen van Rijn
229c734820 Add comments to builtin.odin, documenting ODIN_* constants. (#5218)
And document constants not previously listed.
2025-05-26 18:58:59 +02:00
gingerBill
594f1b30b4 Add Suggestion: 'context = runtime.default_context()' 2025-05-24 14:18:16 +01:00
Jeroen van Rijn
84b140f963 Rename -keep-test-executable to -keep-executable 2025-05-23 08:47:48 +02:00
Jeroen van Rijn
f716d4c88f your your 2025-05-23 08:32:16 +02:00
Jeroen van Rijn
12167bace0 Tweak #5202
Back out the new `-build-only` for tests in favor of the more established `-build-mode:test`, but retain the new `-keep-test-executable` option and default cleanup of test executables.
2025-05-23 08:28:27 +02:00
Feoramund
6c5b96948e Enable all sanitizers on FreeBSD 2025-05-22 21:39:35 -04:00
Feoramund
5b5822effc Delete test executable after running, add -keep-test-executable 2025-05-22 17:58:51 -04:00
Feoramund
0536f86268 Add -build-only for odin test command
This allows test executables to be only built, not run too.
2025-05-22 17:33:24 -04:00
gingerBill
34e998c1fc Merge pull request #5173 from Feoramund/fix-linux-shared-lib-runtime-call
Keep shared libraries from calling main program's startup/cleanup procs on Linux
2025-05-22 15:27:53 +01:00
Feoramund
713360a792 Keep shared libraries from calling main program's startup/cleanup procs on Linux 2025-05-22 09:40:37 -04:00
Feoramund
e35e1dcc7b Only trim .odin from build filenames 2025-05-22 08:23:06 -04:00
Jeroen van Rijn
f8bbeb54d4 Slight tweak. 2025-05-21 20:28:21 +02:00
Jeroen van Rijn
c32b7ba593 List -subtarget in odin help build 2025-05-21 20:24:27 +02:00
Jeroen van Rijn
95183e4b9c Remove now unnecessary checks. 2025-05-21 19:37:09 +02:00
Jeroen van Rijn
96fd07e0ee Fix #5177 - Tweak error messages. 2025-05-21 19:20:58 +02:00
Feoramund
c090a28b9d Add /usr/local/lib to FreeBSD linker path 2025-05-20 18:56:18 -04:00
Feoramund
b018528833 Do not call disabled deferred procedures 2025-05-19 20:50:43 -04:00
Jeroen van Rijn
ab95932502 -dynamic-literals 2025-05-19 20:44:27 +02:00
Jeroen van Rijn
b7783cac05 Merge pull request #5181 from Feoramund/fix-5167
Make `odin help` more precise
2025-05-19 15:38:09 +02:00
Feoramund
2c25a72b45 Make certain commands fail if passed excess arguments 2025-05-19 09:28:17 -04:00
Feoramund
4495a4c58e Check for -help sooner and show it immediately 2025-05-19 09:28:17 -04:00
Feoramund
a5926532a2 Sync command descriptions between odin help and usage 2025-05-19 09:28:17 -04:00
Feoramund
fa63d351ac Add missing commands to odin help 2025-05-19 09:28:17 -04:00
Feoramund
e8d52ac2bc Make odin help more precise about what it accepts 2025-05-19 09:28:17 -04:00
Feoramund
eb051a2d7c Re-enable static map calls on AMD64 SysV 2025-05-18 17:13:39 -04:00
gingerBill
dd31075c33 Merge pull request #5171 from laytan/fix-global-and-static-any
fix global and static any
2025-05-18 16:59:34 +01:00
Feoramund
591118c688 Use --sysroot instead of -Wl,-syslibroot on Darwin
This keeps the linker from using the wrong SDK and mirrors how we build
the Odin compiler itself in `build_odin.sh`.
2025-05-18 11:11:02 -04:00
Laytan Laats
c35a45e823 fix global and static any
Fixes #4627
2025-05-17 16:49:30 +02:00
Jeroen van Rijn
7c80df4830 @(init), @(fini) and @(export) procedures are classified as used.
For the purposes of `-vet-unused-procedures`, exported procedures and `@(init)` and `@(fini)` are now disregarded.
2025-05-17 16:22:47 +02:00
gingerBill
8337b7cccb Merge pull request #5162 from 0xrsp/tounsigned
new compiler intrinsics type_integer_to_unsigned, type_integer_to_unsigned
2025-05-17 11:51:57 +01:00
tf2spi
2f636886a5 Add debug info for labels (#4385)
* Emit label debug info w/o location

* Insert debug label call

* Slight refactor for later fix

* Improve debug labels for block statements

* Improve debug info with for loops

* Generate label lbBlocks w/ debug

* Lightly refactor lb_add_debug_label

* Revise comments, add null check assertion

* Use LLVM-C API for debug labels

* Prefer C DILabel API for POSIX, fallback to CPP

* Use version check for LLVM-C DILabel
2025-05-15 22:11:06 +02:00
Laytan Laats
2d00f8d69d fix compat with earlier llvm versions 2025-05-15 19:20:04 +02:00
0xrsp
649cad2f1b add: type_integer_to_* error messages 2025-05-15 01:12:06 +09:30
0xrsp
ea806f1d5e new compiler intrinsics type_integer_to_unsigned,type_integer_to_signed 2025-05-15 01:00:40 +09:30
Jeroen van Rijn
ed56a7ca10 Parse odin version date out of HEAD commit if available 2025-05-13 18:09:30 +02:00
gingerBill
0a12c464ab Change Odin's RTTI section name to .odinti 2025-05-13 08:58:02 +01:00
gingerBill
d2d5c40e76 Handle "untyped" case 2025-05-12 16:49:59 +01:00
gingerBill
d2d4ac8120 Add compress_values 2025-05-12 15:29:43 +01:00
Laytan Laats
f9b9e9e7dc some ABI fixups and improvements
Started with trying to enable asan in the CI for MacOS, noticed it wasn't enabled on the `tests/internal`
folder, it came up with a couple of issues with the abi/OdinLLVMBuildTransmute that this also solves.

- Looking at clang output for arm64, we should be promoting `{ i64, i32 }` to `{ i64, i64 }`
- after doing the previous point, I noticed this is not handled well in OdinLLVMBuildTransmute
  which was emitting loads and stores into the space of a value that was alignment, asan does not want this,
  looking at clang output again, a memcpy is the appropriate way of handling this.
- Having done this we don't need the hacky "return is packed" set anymore in the amd64 sysv ABI anymore either
2025-05-09 23:03:17 +02:00
gingerBill
8a225a6887 Place RTTI into its own section .odin-rtti 2025-05-09 11:07:53 +01:00
gingerBill
23aff08556 Merge pull request #5117 from bogwi/bug/5024
Bug/5024
2025-05-09 08:35:16 +01:00
gingerBill
92df892f25 Merge pull request #5064 from harold-b/hb/objc-classes
Add support for Objective-C class implementation
2025-05-08 12:58:33 +01:00
Laytan Laats
ad4866653a fix disposing builder when not created
Fixes #5128

p->builder is created in lb_begin_procedure_body, but that isn't called
if there is no body, and we were still calling dispose at that point.

Moved it into lb_end_procedure_body to match.
2025-05-07 14:39:51 +02:00
gingerBill
90a30a145a Merge pull request #5122 from Lperlind/asan-allocators
Add asan support for various allocators and stack unpoisoning
2025-05-07 10:21:16 +01:00
Lucas Perlind
46e0c7ad74 Cleanup 2025-05-07 11:30:58 +10:00
gingerBill
0cf5b5984d Merge pull request #5108 from Barinzaya/core-simd-indices-redadd-redmul
Alternate `reduce_add`/`reduce_mul` intrinsics
2025-05-06 15:46:49 +01:00
Jeroen van Rijn
8097b59e30 Also allow comparing SOA pointers against each other
This compares the data pointer *and* the index.

```odin
package scratch

import "core:fmt"

Foo :: struct {a, b: int}

main :: proc() {
    a := new(#soa[dynamic]Foo)
    a^ = make(#soa[dynamic]Foo, 12, 12)

    b := new(#soa[dynamic]Foo)
    b^ = make(#soa[dynamic]Foo, 12, 12)

    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[0], &a[0] == &b[0]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[1], &a[0] == &b[1]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[2], &a[0] == &b[2]) // Same: false

    fmt.printfln("&a[0]: %p, &a[1]: %p, Same: %v", &a[0], &a[1], &a[0] == &a[1]) // Same: false
    fmt.printfln("&a[1]: %p, &a[2]: %p, Same: %v", &a[1], &a[2], &a[1] == &a[2]) // Same: false
    fmt.printfln("&a[2]: %p, &a[3]: %p, Same: %v", &a[2], &a[3], &a[2] == &a[3]) // Same: false

    fmt.printfln("&a[0]: %p, &a[0]: %p, Same: %v", &a[0], &a[0], &a[0] == &a[0]) // Same: true
    fmt.printfln("&a[1]: %p, &a[1]: %p, Same: %v", &a[1], &a[1], &a[1] == &a[1]) // Same: true
    fmt.printfln("&a[2]: %p, &a[2]: %p, Same: %v", &a[2], &a[2], &a[2] == &a[2]) // Same: true
}
```
2025-05-06 15:10:08 +02:00
bogwi
904a64a45e Add support for SoaPointer nil comparison in lb_emit_comp_against_nil 2025-05-06 14:21:18 +09:00
Lucas Perlind
83bc2d3c4a Add asan support for various allocators 2025-05-06 14:55:50 +10:00