21861 Commits

Author SHA1 Message Date
Veikka Tuominen
886fa455fa Sema: avoid analyzing functions which failed when inlining 2022-12-14 14:08:21 +02:00
Veikka Tuominen
e6588857df Sema: fix memory management of union enum tag int tag
This likely went unnoticed due to all power of two integer types being special cased.

Closes #13812
2022-12-14 14:08:21 +02:00
Veikka Tuominen
41913ddb1a remove no longer relevant stage1 compile errors 2022-12-14 14:08:21 +02:00
Veikka Tuominen
927d20b46b Sema: implement missing stage1 errors 2022-12-14 14:08:21 +02:00
Veikka Tuominen
423d7a74a4 move async compile errors into their own folder 2022-12-14 14:05:57 +02:00
Veikka Tuominen
327fb798c3 move stage2 compile errors out of special folder 2022-12-14 14:05:57 +02:00
IntegratedQuantum
0b4461d97b
Fix tautological big_int tests. 2022-12-14 00:29:25 +00:00
jackji
f1b536c44c expose VcpkgRoot so that build script can call exe.addVcpkgPath 2022-12-13 19:19:27 -05:00
Andrew Kelley
6378644d4e
Merge pull request #13907 from Vexu/call-merge
Remove `stack` option from `@call`
2022-12-13 18:15:18 -05:00
Jakub Konka
ec2697b7ea darwin: add even more wrappers for Mach syscalls
Rename `ThreadId` to `MachThread`.
2022-12-14 00:10:26 +01:00
Veikka Tuominen
65270cdc33
Merge pull request #12298 from r00ster91/debugerror
std.debug: handle some possible errors and resolve low-hanging TODOs
2022-12-14 00:42:31 +02:00
Andrew Kelley
9be5323e93 add zig objcopy subcommand
This commit moves the logic from `std.build.InstallRawStep` into `zig
objcopy`. The options here are limited, but we can add features as
needed.

closes #9261

New issues can be opened for specific objcopy flag support.
2022-12-13 15:37:52 -05:00
Jonathan Marler
5d3adc568c add std.mem.reverseIterator 2022-12-13 15:13:25 -05:00
Evin Yulo
02b4ea71e3 Improve tagged union documentation
closes #13870
2022-12-13 15:11:43 -05:00
Manlio Perillo
35c6fe665c langref: document extern variadic functions
Add a new subsection within the C section, documenting extern variadic
functions.
2022-12-13 15:09:08 -05:00
Meghan
332020f310 std: add object format extension for dxcontainer
source: https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst
2022-12-13 15:06:55 -05:00
Ganesan Rajagopal
21c2bca908 Allocator.zig: minor fixes
* Remove recursive call using null alignment, since it's no longer relevant.
* Fix comment
2022-12-13 15:04:03 -05:00
Manlio Perillo
6486ee9fc7 langref: remove the trailing slash from the link element
A self-closing tag for void elements like link is only required under
XHTML 1.0.

See https://developer.mozilla.org/en-US/docs/Glossary/Void_element#self-closing_tags.
2022-12-13 15:02:48 -05:00
Manlio Perillo
17d85a72c4
langref: add missing ReleaseSmall when describing unreachable (#13909)
Add a missing ReleaseSmall when describing unreachable in the try
section and the unreachable entry in the Keyword Reference section.

Additionally, transform Debug, ReleaseSafe, ReleaseFast and ReleaseSmall
into links in the try section.

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2022-12-13 15:02:17 -05:00
Manlio Perillo
89a9e927ad langref: improve the test_fn_reflection.zig doctest
Currently, the test_fn_reflection.zig doctest has an example of
.Fn.is_var_args.  This example can confuse the reader, since there is no
documentation about variadic functions and is_var_args is mainly used in
the compiler.

Remove the example with .Fn.is_var_args and add instead examples with
.Fn.return_type and .Fn.is_generic.
2022-12-13 15:00:42 -05:00
Manlio Perillo
1d5368fa35 langref: fix the slice_bounds.zig doctest
In the slice_bounds.zig doctest, the code "const slice = array[2..4]" is
incorrect, since the actual type is a pointer to an array, instead of a
slice.

Use a runtime know value to slice the array.
2022-12-13 14:59:46 -05:00
Manlio Perillo
21dafd7a54
langref: update comments in the slices.zig doctest (#13819)
In the slices.zig doctest, the code
`const all_together_slice = all_together[0..]` is incorrect, since the
actual type is a pointer to an array, instead of a slice.

Use a runtime-known value to slice the array.

In the next "slice pointer" test, clarify that slicing a slice to
produce a pointer to an array, requires comptime-known indexes, not just
constant indexes.
2022-12-13 14:58:52 -05:00
Frechdachs
478544239e
std: Fix update() method in PriorityQueue and PriorityDequeue (#13908)
Previously the update() method would iterate over its capacity, which may contain uninitialized memory or already removed elements.
2022-12-13 14:55:41 -05:00
Andrew Kelley
2e66b3be6e
Merge pull request #13910 from Luukdegram/wasm-simd 2022-12-13 14:11:22 -05:00
Luuk de Gram
41199bba4b
wasm-linker: Create separate path for one-shot
When invoking the self-hosted linker using `-fno-LLD` while using the
LLVM backend or invoking it as a linker, we create a seperate path.
This path will link the object file generated by LLVM and the
supplied object files just once, allowing to simplify the
implementation between incremental and regular linking.
2022-12-13 19:19:05 +01:00
Jakub Konka
f5336a8fec darwin: add ability to dealloc obtained thread list for a task 2022-12-13 15:29:49 +01:00
Jakub Konka
f505cb96f4 darwin: add thread_act_t wrapper and helpers 2022-12-13 12:53:10 +01:00
Meghan
3318611618 re-enable "signed zeros are represented properly" beahvior tests for f80 and c_longdouble 2022-12-13 13:33:16 +02:00
Veikka Tuominen
51ed5416ab update zig1.wasm to @call changes 2022-12-13 13:14:20 +02:00
Veikka Tuominen
08b2d491bc update usages of @call 2022-12-13 13:14:20 +02:00
Veikka Tuominen
7b2a936173 remove stack option from @call 2022-12-13 12:52:21 +02:00
Jakub Konka
2efd0eb884 darwin: wrap task_threads mach syscall 2022-12-13 11:36:00 +01:00
r00ster91
7561f63b5d std.debug: use OpenSelfDebugInfoError 2022-12-13 09:11:30 +01:00
r00ster91
d0d845a25b cleanup: inline color constants
Originally I just wanted to move these down because they seemed to be in some random position of the file,
but these constants look very old with their CASING and pretty unnecessary anyway so I just inlined them.
2022-12-13 09:11:30 +01:00
r00ster91
d8b4588d5f fix(terminal): handle some possible errors and resolve TODOs 2022-12-13 09:11:30 +01:00
Andrew Kelley
8691fde0f6 CI: override cache folders on aarch64-windows
This matches the scripts we use for our other self-hosted runners.
2022-12-13 02:41:53 -05:00
gettsu
175d018512
langref: avoid use of the term "enum variant" in enums.zig (#13847) 2022-12-12 23:49:42 -05:00
Cody Tapscott
25d3713b07 stage2: Teach Liveness that safety checks do not modify memory
This change adds to Liveness a simple pattern match for the
try-like `.condbr` blocks emitted by Sema's safety checks. This
allows us to determine that these do not modify memory, which
permits us to elide additional loads in the backend.

As @Vexu points out in the main issue, this is probably not a
complete solution on its own. We'll still want a way to reliably
narrow the load/copy when performing several consecutive accesses,
such as `foo.arr[x][y].z`

Resolves https://github.com/ziglang/zig/issues/12215
2022-12-12 18:48:10 -05:00
Tom Maenan Read Cutting
d0eef26687 Add 0-length buffer checks to os.read & os.write
This helps prevent errors related to undefined pointers being passed
through to some OS apis when slices have 0 length.

Tests have also been added to catch these cases.
2022-12-12 15:10:59 -05:00
Manlio Perillo
09cc6b4b9e langref: improve the defer section
Split the original `defer.zig` doctest into 3 doctest:

  1. Document the defer keyword
  2. Document that the return statement is not allowed inside a defer
     expression
  3. Document the errdefer keyword

Replace "method" with "expression" in the text `defer method`.
2022-12-12 15:09:45 -05:00
fsh
e0ba8b8ae5
std: fix bug in Pcg32 fill function (#13894)
The PCG32 fill function seems to have been copy-pasted from code using u64, so requesting `n` bytes where `(n & 7) > 4` bytes would cause the last few bytes to be all 0.
2022-12-12 14:19:49 -05:00
Jakub Konka
6f5eb9927d darwin: add more defs and wrappers 2022-12-12 20:04:46 +01:00
Luuk de Gram
37561a920b
wasm: enable passing vector tests 2022-12-12 17:42:09 +01:00
Luuk de Gram
355b5929b2
wasm: splat for vector elements divisible by 8
This implements `@splat` for vectors where the element type is
divisible by 8 and a power of two. This is fairly simple as we can
store the values directly within the virtual stack. But for
all other sizes, we must first shift and bitwise-or the values
before we can store them to fit them like a packed-struct, rather
than an array.
2022-12-12 17:42:00 +01:00
Luuk de Gram
c6d654f73b
wasm: implement the 'splat' instruction part 1
This implements `airSplat` for the native WebAssembly backend when
the features 'simd128' or 'relaxed-simd' are enabled. The commit
supports splat where the value lives in the linear memory segment,
as well as on the stack. This saves a lot of instruction cost.
When it detects the element type is not 8, 16, 32 or 64 bits,
the backend will instead use the same strategy as if the features
where disabled.
2022-12-12 17:42:00 +01:00
Luuk de Gram
db06eed7a3
codegen: implement generating vector values 2022-12-12 17:41:59 +01:00
Luuk de Gram
63b69e2c55
wasm: load+store simd immediate values
This implements loading and storing immediate values representing
a vector with exactly 128 bits. When the vector does not equal to
128 bits, or when the simd128 or relaxed-simd features are disabled
the value will be treated as an array instead.
2022-12-12 17:41:59 +01:00
Luuk de Gram
5a6b6992d8
std: Add Wasm SIMD opcodes and value type
This adds the opcodes for both the simd128 and relaxed-simd features.
Those instructions are required by the self-hosted WebAssembly
backend. Additionally, this also adds the new `v128` Valtype which
is required to represent a 128bit simd value. SIMD values that do
not have exactly 128 bits will be represented differently.
2022-12-12 17:41:56 +01:00
Andrew Kelley
4832677c3b
Merge pull request #13896 from coin3x/revert-aarch64-windows-test-workarounds
Revert test workarounds for aarch64-windows
2022-12-12 04:49:52 -05:00
yujiri8
d36cd49f0b
zig fmt: remove c_void -> anyopaque rewrite
TODO comments said to remove this
2022-12-12 10:46:28 +01:00