Commit Graph

6086 Commits

Author SHA1 Message Date
gingerBill
6412c84690 Merge branch 'master' into bill/range-init 2026-02-12 13:15:39 +00:00
Laytan Laats
d49ab07d35 fix typo 2026-02-11 20:05:45 +01:00
Jeroen van Rijn
bd3cf2a1e6 Remove -show-import-graph header
This allows you to pipe the output to a file and have a working graph without any editing.
(Provided you don't also use additional -flags like `-show-timings`.)
2026-02-11 16:33:52 +01:00
gingerBill
8cb7965aa5 for init; x in y {} style loops 2026-02-11 15:33:14 +00:00
Jeroen van Rijn
2e58c62a80 Clarify -lto help text 2026-02-11 15:13:24 +01:00
gingerBill
b1633b9ebb Require all values from a procedure iterator if the procedure is marked with @(require_results) 2026-02-11 14:05:06 +00:00
Krzesimir Nowak
6cc6f06d4d Stop silently ignoring unknown directives on an inline asm expression 2026-02-11 13:22:13 +01:00
gingerBill
ae91b9b369 Add -show-import-graph 2026-02-10 22:16:15 +00:00
gingerBill
6f7a64a47d Change LTO rules for all platforms 2026-02-04 17:15:48 +00:00
gingerBill
b942f72cb0 Add docs for -lto:<string>; remove -lld and -radlink flags docs; with -lto default to -use-separate-modules and -linker:lld 2026-02-04 12:45:26 +00:00
Jesse Meyer
b8276065f9 Merge branch 'master' into lto-support 2026-02-03 20:52:52 -05:00
Jesse Meyer
bd6148dd6b Fix Windows LTO: preserve required procedures with llvm.used
On Windows with LTO, required procedures with external linkage need to
be added to @llvm.used to survive linker-level dead code elimination.

LLVM may generate implicit calls to runtime builtins (e.g., __extendhfsf2
for f16 conversions) during instruction lowering, after the IR is
finalized. Without @llvm.used, the linker discards these procedures
before the implicit calls are generated.

This adds required procedures to @llvm.used at creation time. The fix
is Windows-specific; other platforms handle this correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:44 -05:00
Jesse Meyer
a0562dfd6e Fix lld-link LTO jobs flag syntax on Windows
lld-link doesn't recognize /lldltojobs:N as a standalone flag and
treats it as a file path. Use /opt:lldltojobs=N instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
Jesse Meyer
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 Meyer
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
f3daaa62fe Merge pull request #6220 from laytan/fix-lto-macos
fix LTO on MacOS
2026-02-02 18:46:18 +00:00
Laytan Laats
afbbb829ea fix LTO on MacOS
If no `-minimum-os-version` is given, ignore the `override-module`
warnings. The user not using, `-minimum-os-version` opts you into linker
warnings about target versions.

If a `-minimum-os-version` is provided, normalize it to a full version
`11` to `11.0.0` for example. The linker seems to want that when doing
LTO.
2026-02-02 18:13:48 +01:00
Jeroen van Rijn
6a07f70c1c support -> supported 2026-02-02 17:57:50 +01:00
gingerBill
bb7496a2fc Add intrinsics.count_trailing_ones and intrinsics.count_leading_ones 2026-02-02 14:28:16 +00:00
gingerBill
a936f3fb7d Comment out t->Struct.are_offsets_being_processed.load() 2026-02-02 11:41:33 +00:00
gingerBill
8594deb4e1 Move return true; to after the if check 2026-02-02 11:40:30 +00:00
gingerBill
2bbedda61c Remove unneeded mutex in hash_exact_value 2026-02-02 11:39:57 +00:00
gingerBill
041ebdd8f6 Add parent mutex lock for scope_insert_with_name 2026-02-02 11:39:17 +00:00
gingerBill
adf56ced22 Merge pull request #6215 from odin-lang/bill/fix-data-races-2026-02
Fix numerous data races
2026-02-02 11:37:19 +00:00
gingerBill
b9e4007cb1 Merge pull request #6216 from odin-lang/bill/debug-info-fixes
Debug Info Fixes
2026-02-02 11:33:21 +00:00
gingerBill
c85af4a454 Fix #6202 2026-02-02 11:27:41 +00:00
gingerBill
b183b1219c Revert mutex_lock logic 2026-02-02 11:25:49 +00:00
gingerBill
63c4faca75 Fix positions for debug locations in defer, loops, and switch clauses 2026-02-02 11:19:00 +00:00
gingerBill
fde90931de Add case for completeness 2026-02-02 11:16:05 +00:00
gingerBill
3dccd4e3ad Fix debug info 2026-02-02 11:15:34 +00:00
gingerBill
e014181abf Move values construction to after padding has been set 2026-02-02 11:12:42 +00:00
gingerBill
21509ae3f4 Fix mutex_lock 2026-02-02 11:06:16 +00:00
gingerBill
ad2122a7fc Move alignas to before name 2026-02-02 11:05:30 +00:00
gingerBill
c7f40b8b8f Use mutex striping for add_type_and_value 2026-02-02 11:03:50 +00:00
gingerBill
acabae8644 Make Entity.parent_proc_decl atomic 2026-02-02 10:58:25 +00:00
gingerBill
8a92ba74fc Make defer_use_checked and where_clauses_evaluated atomic 2026-02-02 10:56:30 +00:00
gingerBill
74347f3069 Make Entity.code_gen_* atomic 2026-02-02 10:53:18 +00:00
gingerBill
d086a16f64 Make atomic variant_block_size and tag_size in TypeUnion 2026-02-02 10:52:14 +00:00
gingerBill
cb50725b86 Use compare_exchange_strong mutex_lock on non-windows sytems 2026-02-02 10:50:30 +00:00
gingerBill
20a7a645c2 Mock out TSAN_* usage in thread_pool.cpp 2026-02-02 10:48:55 +00:00
gingerBill
2608f92fee Use std::atomic for Ast.viral_state_flags and Ast_Ident.entity 2026-02-02 10:48:30 +00:00
Jesse Meyer
1a7f78b665 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-01 09:04:53 -05:00
gingerBill
19b545e7cb Merge branch 'master' into bill/feature-using-stmt 2026-01-30 10:49:55 +00:00
gingerBill
7125782bd2 Support -linker:mold on FreeBSD and NetBSD; Remove -use-lld and -use-radlink 2026-01-30 10:46:35 +00:00
Faker-09
30ef01ee8d Merge branch 'odin-lang:master' into vet_flags 2026-01-29 11:35:24 -05:00
gingerBill
67541434f4 Remove else check for untyped to typed 2026-01-29 11:58:37 +00:00
gingerBill
07d814d9cf Add struct #simple to force a struct to use simple comparison if all of the fields "nearly simply comparable". 2026-01-29 10:49:26 +00:00
gingerBill
4a7fb46667 Complete is_type_simple_compare switch rules 2026-01-29 09:21:31 +00:00
Shane Shrybman
f6322b4b31 Fix for vet flags. All combinations of vet flags on the command line and top of file are working 2026-01-28 14:18:30 -05:00
gingerBill
37c2f68824 Allow #unroll for arrays of fixed length which are not constants 2026-01-28 15:30:23 +00:00