Commit Graph
786 Commits
Author SHA1 Message Date
gingerBill 6a8d6e0ca4 Verify each module once its procedures are generated rather than each procedure, which for those referenced by the type info walked all of the type info each time; only verify the procedures on their own on a failure 2026-10-02 15:55:54 +01:00
gingerBill 03852e7af8 Generate each global's initialization in its own block of the startup procedure; generate the procedure literals reached from the initializations of globals in their own package's module rather than the default module 2026-10-02 15:36:04 +01:00
gingerBill 5f579a1a10 Fix numerous race conditions: clone polymorphic defaults per call, evaluate foreign import attributes after collection, own dependencies for record instances, sorted Objective-C emission, no debug line for anonymous records 2026-10-01 21:55:25 +01:00
gingerBill 73c3a96de1 Make global checking state thread-safe: read-only global scopes, per-group untyped and #soa, deferred link-name checks, fresh contexts for on-demand globals 2026-10-01 21:07:41 +01:00
gingerBill 38fa57e907 Make global checking and codegen order-independent 2026-10-01 15:01:14 +01:00
Jeroen van Rijn 650c558cb9 Merge pull request #7445 from kalsprite/target_feature_empty_element
string_split_iterator fix
2026-08-24 18:03:35 -07:00
kalsprite 7bf266ef93 string_split_iterator fix 2026-08-24 17:32:30 -07:00
Mihail Moskov 74ac336ef1 fixes -o:size 2026-08-24 12:53:05 +03:00
korvahkh 02246ac6fd Implement fixes for constant unions
Note that with this commit, casting through
multiply-nested unions is forbidden, e.g.
```
U :: union {int, V}
V :: union {bool}
x: U = true
```
does not compile.
(Previously the compiler would simply crash)

This is to avoid situations where adding variants
can lead to unexpected changes in the value.

For example if `U` is changed to have a `bool`
variant of its own:
```
U :: union {int, bool, V}
```
Then `x: U = true` would equal
`U(true)` instead of `U(V(true))`.

Single-variant unions are exempt, primarily to
improve the ergonomics of `Maybe` in cases like:
```
x: Maybe(union{int, bool}) = 1
```

Fix #6100
Fix #6699
Fix #6895
Fix #6896
Fix #6897
Fix #7036
Fix #7083
Fix #7091
2026-08-19 20:12:56 -05:00
kalsprite cf5f181228 peel union constant to its variant 2026-08-19 16:30:37 -07:00
kalsprite cd8fc51efc codegen worker must not exit process with running siblings 2026-08-19 13:44:32 -07:00
gingerBill 9870cd4c36 Merge pull request #7271 from odin-lang/bill/inline-asm
`asm` templates
2026-08-18 19:19:40 +02:00
gingerBill 645b57be9f Merge pull request #7327 from kalsprite/abi_conformance
ABI Conformance Harness + Fixes
2026-08-17 16:28:01 +02:00
gingerBill 1f2234a4b2 Merge branch 'master' into bill/inline-asm 2026-08-17 11:44:14 +01:00
kalsprite 9047c60ec1 arm32: default to arm1176jzf-s so the gnueabihf triple actually has an FPU,
arm32: implement AAPCS32 homogeneous float aggregates incl unions,
arm32: fix reversed arguments in the small-struct return coercion,abi test: __aeabi_uldivmod so the arm32 corpus links
2026-08-14 18:08:11 -07:00
corley de9d6d7dcc Reenables LLVMSetUnnamedAddress for global constants folding 2026-08-14 23:12:25 +03:00
A1029384756 a08682bcd3 [llvm_backend] fix duplicated name for .ll files 2026-08-11 16:30:35 -04:00
gingerBill 036e38442b Begin work on lb_emit_asm_template_call 2026-08-09 21:55:36 +01:00
David Bader 865b97fa9e Make object and assembly file extensions user-changeable again 2026-07-14 14:02:09 +02:00
Jagi Natarajan 8727db41f7 Fix regression, fetch obj-c superclass name instead of class name 2026-07-09 14:24:40 -04:00
Jeroen van Rijn 94be05ead1 Merge pull request #6918 from Kelimion/deprecate-llvm-14
Remove LLVM 14 support
2026-07-03 21:35:47 +02:00
Jeroen van Rijn 03652d7423 Improve custom output location for LLVM-IR, OBJ + ASM
Fixes #6926.

If `build` is a subdirectory in the current directory, then `odin build . -out:build` will place `.S`, `.obj` and `.ll` files there if the corresponding `-build-mode` is given.
2026-07-02 14:19:56 +02:00
Jeroen van Rijn 2d2979a5f2 Remove old pass manager 2026-06-30 22:44:28 +02:00
gingerBill 40e54a97ed Merge branch 'master' into bill/bedrock 2026-06-24 11:07:02 +01:00
gingerBill 69daa4d184 Merge pull request #6830 from A1029384756/stack-canaries
Stack canaries
2026-06-19 09:11:40 +01:00
Franz 5fdfbf7c06 Fix initialization of global anys 2026-06-16 00:24:47 +02:00
A1029384756 8bd95d4082 [stack-canaries] fixed stack canaries on arm linux 2026-06-13 01:52:19 -04:00
A1029384756 da742fc526 [no-plt] enable no-plt behavior on linux arm64 and amd64 targets 2026-06-08 10:58:05 -04:00
A1029384756 43b057dfeb [linux] change default settings to enable pie and full relro 2026-06-06 21:23:26 -04:00
gingerBill 8d1d126e16 Rearrange context and value_type values of lb_const_value 2026-06-05 10:19:55 +01:00
gingerBill eaa32a82e8 Fix global constant union initialization bug. 2026-05-29 09:38:56 +01:00
gingerBill dbb62f240a Disallow Objective-C setup with -bedrock 2026-05-04 11:52:09 +01:00
gingerBill cdc0efce43 -disallow-non-constant-globals 2026-05-04 11:28:57 +01:00
Ignacy Koper d1915fa6f5 removed Haiku from compiler targets, and tests
Signed-off-by: Ignacy Koper <ignacy423@gmail.com>
2026-04-28 19:27:23 +02:00
Znarf e0d84ce73a Merge branch 'odin-lang:master' into master 2026-03-19 00:34:44 +01:00
gingerBill 04cb889aed Begin interning ScopeMap strings 2026-03-17 11:04:32 +00:00
gingerBill 1744f57d01 Use permanent_alloc_item directly rather than through the gb_alloc_item generic interface 2026-03-16 16:03:27 +00:00
gingerBill fa6109ca1e Properly dispose of LLVMTargetDataRef 2026-03-15 21:35:26 +00:00
gingerBill c6772dfd06 Merge branch 'master' into bill/fixed-capacity-dynamic-array 2026-03-15 11:41:01 +00:00
Laytan af8853473a query host features instead of only host cpu for more accurate -microarch:native 2026-03-13 20:15:33 +01:00
Franz ee3d0ea0b5 Fix #6407 2026-03-13 14:21:42 +01:00
gingerBill bc636e4b36 raddbg debug view for fixed capacity dynamic arrays 2026-03-12 12:56:00 +00:00
Jesse MeyerandClaude Opus 4.5 9eba12948a Skip sanitizer IR passes when LTO is enabled
With ThinLTO, the linker runs sanitizer passes at link time via
-fsanitize= flags, where it has whole-program visibility. Running
them at bitcode emission too double-instruments every module,
producing hundreds of "Redundant instrumentation detected" warnings.
Per-function sanitize/no_sanitize attributes are preserved in the
bitcode and respected by the linker's pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
Jesse MeyerandClaude Opus 4.5 43ad4a1d9f Add ThinLTO support via -lto:thin and -lto:thin-files flags
- Add -lto:thin and -lto:thin-files CLI flags with validation
- Emit LLVM bitcode (.bc) instead of object files when LTO is enabled
- Pass -flto=thin and -flto-jobs to clang/lld linkers
- Guard linkage corrections to skip declarations without definitions
  (required for LTO where declarations appear across modules)
- Allow module-per-file with LTO even at higher optimization levels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
gingerBill 5072d5c776 Add warning in code generation stage which might cause a possible code gen issue, when non-constant initialization is large 2026-01-22 13:54:53 +00:00
gingerBill 4ace851f9a Instead of using typeid hash, use the canonical name for internal procedure for debuggability 2026-01-22 13:17:26 +00:00
gingerBill 0366cd3304 Add #must_tail (similar syntax to #force_inline 2026-01-15 16:32:52 +00:00
gingerBill 70affd7e44 Disable global variable initialization into separate functions to circumvent an LLVM bug 2025-12-19 16:23:48 +00:00
gingerBill e0e38afe60 With -use-single-module make some procedures use internal linkage rather than weak linkage 2025-12-17 10:27:28 +00:00
Tohei Ichikawa d6b5a3139a Fix allocation of anonymous globals 2025-11-09 21:07:28 -05:00