14951 Commits

Author SHA1 Message Date
Andrew Kelley
a57479afc2
Merge pull request #20652 from pavelverigo/stage2-wasm-finishAir
stage2-wasm: finishAir enhancement
2024-07-17 22:33:29 -07:00
Pavel Verigo
31706dc31a stage2-wasm: finishAir handle .stack result
By allowing finishAir to handle .stack results, we simplify a lot of code in
air*** functions, which try to handle this case. Also this changes will result in optimization, if one of operands is dead after instruction its place could be reused by result.

The only downside to this change is that finishAir now can return error, though it handled by returning finishAir result, because it always needs to be final in air*** functions.

Additionally I migrated WValue{ to .{ inside CodeGen.zig.
2024-07-18 00:57:45 +02:00
Pavel Verigo
6eb76f930d stage2-wasm: typeToValtype focus on .auto callconv
This is required for toLocal() correctly handling isByRef values, previous behavior was a hack.
2024-07-18 00:57:18 +02:00
Jakub Konka
9d9b5a11e8
Merge pull request #20474 from Rexicon226/riscv
more RISC-V backend progress
2024-07-17 08:39:44 +02:00
Matthew Lugg
e82f7d3800
Merge pull request #20653 from mlugg/incremental-fix
Zcu: updateZirRefs typo
2024-07-17 00:08:13 +01:00
Hayden Riddiford
20563d8457 - Added special handling for translating C extern variables declared within scoped blocks
- Added test/cases/run_translated_c/extern_typedef_variables_in_functions.c to test for issue 19687
2024-07-16 23:29:44 +03:00
Jacob Young
88bb0fd288
Merge pull request #20632 from jacobly0/codegen-thread
InternPool: enable separate codegen/linking thread
2024-07-16 14:49:49 -04:00
mlugg
6bd640c7a0
Sema: typo 2024-07-16 19:48:05 +01:00
mlugg
21cde7ad90
Zcu: updateZirRefs typo 2024-07-16 19:46:10 +01:00
mlugg
d8f81372f1
Sema: fix bad merge 2024-07-16 19:44:41 +01:00
Matthew Lugg
ee695c8ef4
Merge pull request #20637 from mlugg/comptime-resolution-strat
Type,Value: mark `ResolveStrat` parameter of type queries as `comptime`
2024-07-16 19:22:39 +01:00
Andrew Kelley
a58ceb3d55
Merge pull request #20646 from ziglang/fix-updateZirRefs
frontend: fix updateZirRefs
2024-07-16 10:47:42 -07:00
Will Lillis
a9d544575d
Sema: add error note for failed coercions to optional types and error unions 2024-07-16 16:42:13 +00:00
mlugg
f84a4953d2
Value: eliminate static recursion loop from value printing 2024-07-16 11:38:21 +01:00
mlugg
67cd14dbdb
Type: avoid incorrect type resolution calls 2024-07-16 11:38:20 +01:00
mlugg
b1d3d48f68
Type,Value: mark ResolveStrat parameter of type queries as comptime
This eliminates the statically-reachable recursion loop between code
generation backends and Sema. This is beneficial for optimizers
(although I do not measure any performance improvement for this change),
and for profilers.
2024-07-16 11:38:20 +01:00
Jacob Young
00fdbf05f3 InternPool: enable separate codegen/linking thread
Let's see what happens :)
2024-07-16 06:28:42 -04:00
Jacob Young
9d1820d206 InternPool: reduce max tid width by one bit
@mlugg keeps stealing my bits!
2024-07-16 06:28:41 -04:00
Jacob Young
b0fe7eef54 InternPool: fix various data structure invariants 2024-07-16 05:14:38 -04:00
Jacob Young
7dbd2a6bb5 InternPool: fix DependencyIterator iteration 2024-07-16 02:24:16 -04:00
Andrew Kelley
a20d081129 Air: remove deprecated/unused decl 2024-07-15 22:04:29 -07:00
Andrew Kelley
3a6ef6ffe1 frontend server: serveUpdateResults fix
Serve empty error bundle to indicate the update is done. Otherwise the
build system, when using -fno-emit-bin, fails to detect the update is
done.
2024-07-15 22:03:10 -07:00
Andrew Kelley
8cb09db4e3 update some Module references to Zcu instead
I ended up reverting my real change, so here's a consolation prize
instead.
2024-07-15 19:05:55 -07:00
Andrew Kelley
60318a1e39 frontend: move updateZirRefs to be single-threaded
for simplicity's sake. This makes it O(M) instead of O(N*M) where N is
tracked insts and M is number of changed source files.
2024-07-15 18:54:41 -07:00
Wooster
888708ec8a
Sema: support pointer subtraction 2024-07-15 18:18:38 +00:00
Andrew Kelley
9d38e82b5c
Merge pull request #20633 from ziglang/long-live-zig
make zig compiler processes live across rebuilds
2024-07-15 01:27:23 -07:00
fmaggi
583e698256
Sema: disallow casting to opaque 2024-07-15 10:58:33 +03:00
David Rubin
5ec926cdbf
riscv: refactor bin_file and zcu usage 2024-07-14 23:04:05 -07:00
David Rubin
5a2c547fc1
riscv: vectors part 3 2024-07-14 23:02:35 -07:00
David Rubin
09e9812086
riscv: vectors part 2 2024-07-14 23:02:34 -07:00
David Rubin
571aa694fd
riscv: vectors part 1 2024-07-14 23:02:34 -07:00
David Rubin
3e73f37d0a
riscv: implement @fence 2024-07-14 23:02:33 -07:00
David Rubin
7a02878f4e
riscv: truncate airStructFieldVal result 2024-07-14 23:02:33 -07:00
David Rubin
27ceb4ae37
riscv implement @sqrt for f32/f64 2024-07-14 23:02:32 -07:00
David Rubin
0460572899
riscv: @atomicRmw
Now we generate debug undefined constants when the user asks for them to dedup across the function decl. This takes 2 instructions instead of 7 in the RISC-V backend.

TODO, we need to dedupe across function decl boundaries.
2024-07-14 23:02:32 -07:00
David Rubin
ea084e9519
riscv: @atomicLoad and @atomicStore 2024-07-14 23:02:29 -07:00
Andrew Kelley
716b128a24 frontend: add -fincremental, -fno-incremental flag
Remove --debug-incremental

This flag is also added to the build system. Importantly, this tells
Compile step whether or not to keep the compiler running between
rebuilds. It defaults off because it is currently crashing
zirUpdateRefs.
2024-07-14 21:18:09 -07:00
Andrew Kelley
abf8955951 make zig compiler processes live across rebuilds
Changes the `make` function signature to take an options struct, which
additionally includes `watch: bool`. I intentionally am not exposing
this information to configure phase logic.

Also adds global zig cache to the compiler cache prefixes.

Closes #20600
2024-07-14 19:51:16 -07:00
Andrew Kelley
d404d8a363
Merge pull request #20593 from jacobly0/more-races
InternPool: fix more races
2024-07-14 17:32:51 -07:00
Andrew Kelley
bd7b2cc4b4
Merge pull request #20620 from kcbanner/fixup_msvc_bootstrap
Fixes for bootrapping with MSVC
2024-07-13 22:42:04 -07:00
Krzysztof Wolicki
fba618a6c9 Fix handling of --save-exact=name in fetch 2024-07-13 22:39:53 -07:00
kcbanner
373e53d7c5 Compile: Pass the default --zig-lib-dir along to child processes
main: print the self_exe_path when `findZigLibDirFromSelfExe` fails in all cases
2024-07-13 19:04:55 -04:00
kcbanner
11534aa34d zcu: fixup incorrect pass-by-value of Zcu 2024-07-13 13:44:39 -07:00
Andrew Kelley
d8c1c9ea6e frontend: report correct paths for C objects
oops, the src_path field of CObject is not relative to the module
owner's root directory.
2024-07-13 02:13:03 -07:00
Jacob Young
ad55fb7a20 Compilation: restore saveState 2024-07-13 04:47:38 -04:00
Jacob Young
2ff49751aa Compilation: introduce work stages for better work distribution 2024-07-13 04:47:38 -04:00
Jacob Young
a1053e8e1d InternPool: add and use a mutate mutex for each list
This allows the mutate mutex to only be locked during actual grows,
which are rare. For the lists that didn't previously have a mutex, this
change has little effect since grows are rare and there is zero
contention on a mutex that is only ever locked by one thread.  This
change allows `extra` to be mutated without racing with a grow.
2024-07-13 04:47:38 -04:00
Jacob Young
9f8e4ddf25 Builder: fix llvm ir syntax 2024-07-13 04:04:14 -04:00
Krzysztof Wolicki
30ef0ed054 Args including and after -- get passed to build runner directly 2024-07-13 00:02:46 -07:00
Andrew Kelley
1d20ff11d7
Merge pull request #20580 from ziglang/watch
introduce file system watching features to the zig build system
2024-07-12 16:56:17 -07:00