Commit Graph
21722 Commits
Author SHA1 Message Date
Andrew Kelley c2f5848fe4 Merge pull request #11594 from KaneRoot/master
Dir.statFile now uses fstatat (fewer syscalls)
2022-12-14 20:54:04 -05:00
Andrew Kelley b911b54aeb CI: fix path to langref when running tidy 2022-12-14 14:26:02 -07:00
Andrew Kelley 32d76f0e4a stage2: remove pub from a private function 2022-12-14 14:26:02 -07:00
Andrew Kelley bac4a5c196 std: remove a solved TODO comment 2022-12-14 14:26:02 -07:00
Andrew Kelley 353121d9d5 std.c.fstatat64: add noalias attributes 2022-12-14 14:26:02 -07:00
Andrew Kelley a62c8d36d5 std.fs.Dir.statFile rework
* revert changes to Module because the error set is consistent across
   operating systems.
 * remove duplicated Stat.fromSystem code and use a less redundant name.
 * make fs.Dir.statFile follow symlinks, and avoid pointless control
   flow through the posix layer.
2022-12-14 14:26:02 -07:00
Philippe Pittoli f65cdef7c8 std.fs.Dir.statFile: use fstatat
This avoids extra syscalls.
2022-12-14 14:11:59 -07:00
Andrew Kelley 4af305b30a Merge pull request #13891 from Vexu/compile-errors
Organize and implement remaining stage1 compile errors
2022-12-14 12:08:08 -05:00
Andrew Kelley 3bf97bfd46 std: remove OOM workarounds
No longer needed since stage1 is deleted.
2022-12-14 11:42:28 -05:00
Jakub Konka b27b17e253 Merge pull request #13935 from ziglang/mach-tasks
darwin: expose more Mach primitives, expose wrapped ptrace, and allow starting suspended for posix_spawn
2022-12-14 17:42:02 +01:00
Veikka Tuominen 014009a730 parser: fix usage of incorrect error tag
Closes #13921
2022-12-14 14:08:22 +02:00
Veikka Tuominen bc97a5662d Sema: display cimport errors from clang 2022-12-14 14:08:22 +02:00
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 PerilloandAndrew Kelley 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
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