23847 Commits

Author SHA1 Message Date
kcbanner
ec6ffaa1e4 sema: improve the error message when coercing to []anyopaque 2023-04-30 16:40:06 -07:00
dweiller
1b432072b5 std.Build: detect and disallow top-level step name clashes 2023-04-30 16:34:34 -07:00
Eric Joldasov
339cae7fd0 cmake: install zig to 'build_dir/stage3' during building
This commit installs Zig to "build_dir/stage3" during building
so that distros' can easily find binary and use it for testing/etc.
This commit also splits "add_custom_target(stage3 ALL" and command that it invokes,
so that it won't retry it during installation,
as target will be considered not out-of-date.

See also https://www.github.com/ziglang/zig/issues/14240#issuecomment-1374642063
2023-04-30 16:31:30 -07:00
Andrew Kelley
91b4729962 fix compilation error on 32-bit LLVM-enabled compiler builds
Fixes a regression introduced in
9295355985202c267b4326b5a6e2ad5158b48e5d that caused 32-bit builds with
`-Denable-llvm` to fail to build from source due to that common
u64/usize casting issue.
2023-04-30 12:14:02 -07:00
Andrew Kelley
ab086b62cf update zig1.wasm
Looks like I might have messed up the wasm kernel in my recent branch causing some sporadic failures on the CI.

This file was built the following way:

1. check out d0311e28b397d173f0d60c403985047ec952a172
2. do the cmake bootstrap
3. check out 57ea6207d3cb2db706bdc06c14605e4b901736dd
4. `zig build update-zig1` and stash those modified files
5. check out 440b3df702f1c8bfddabc1c594a3f49cf0011a63 (master)
6. do the cmake bootstrap
7. `zig build update-zig1` to produce this commit
2023-04-30 10:54:20 -07:00
David CARLIER
3fb93fc8f2 std.c: freebsd add procctl exclusive x86_64 flags 2023-04-30 12:28:36 +03:00
David CARLIER
4f248e1b51 std.c:complete further more netbsd's mmap flags 2023-04-30 12:21:35 +03:00
kcbanner
440b3df702 main: parse --dynamicbase linker arg 2023-04-29 22:19:02 +02:00
Andrew Kelley
c83ab7cc6a
Merge pull request #15503 from r00ster91/noinline
Sema: emit error for always_inline call of noinline function
2023-04-29 11:13:51 -07:00
Andrew Kelley
7baf0de807
Merge pull request #15458 from koachan/sparc64-codegen
stage2: sparc64: Yet another patchset for the selfhosted backend
2023-04-29 10:55:50 -07:00
Loris Cro
13aaa16ab2
Merge pull request #15478 from der-teufel-programming/autodoc-decltests
autodoc: Gather and display decltests
2023-04-29 18:23:18 +02:00
r00ster91
dff6efe369 Sema: disallow indexing non-tuple struct
Fixes #15497
2023-04-29 14:28:36 +03:00
David CARLIER
05f9608115 std.c: add mincore api to darwin. 2023-04-29 14:25:37 +03:00
Andrew Kelley
d65b42e07c
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
2023-04-29 00:19:55 -07:00
r00ster91
bd8b5c25ec Sema: emit error for always_inline call of noinline function
Fixes #15489

This also lays the groundwork for exposing the whether or not a function is
noinline in std.builtin.Fn as an `is_noinline: bool` field if we ever want to do that.
2023-04-29 04:19:58 +02:00
r00ster91
0c9c9117ba std.builtin.CallModifier: add missing word 2023-04-29 03:35:37 +02:00
Koakuma
ccc9b8caf6 stage2: sparc64: Implement airPtrSliceLenPtr/airPtrSlicePtrPtr stubs 2023-04-28 16:46:04 -07:00
Koakuma
75a1360cdd stage2: sparc64: Implement ASI load/store ops 2023-04-28 16:46:04 -07:00
Koakuma
83e6223192 stage2: sparc64: Implement airByteSwap 2023-04-28 16:46:04 -07:00
Koakuma
486ab3852e stage2: sparc64: Factor machine offset calculation 2023-04-28 16:46:04 -07:00
Koakuma
cc2a5185d6 stage2: sparc64: Implement airStructFieldPtr 2023-04-28 16:46:03 -07:00
Koakuma
1794a45572 stage2: sparc64: Add stub for c_va_* 2023-04-28 16:45:37 -07:00
Koakuma
d339e86fb1 stage2: sparc64: Skip unimplemented tests 2023-04-28 16:45:37 -07:00
Krzysztof Wolicki
aa51a5c557 autodoc: Gather and display decltests 2023-04-29 00:54:23 +02:00
Andrew Kelley
fa200ca0ca update zig1.wasm
This is needed because bug fixes to the C backend are required in order
to actually update the standard library and compiler sources to use the
new `@memcpy` and `@memset` semantics.
2023-04-28 13:29:39 -07:00
Andrew Kelley
85ffb8f18f disable 2 failing behavior tests with x86 backend 2023-04-28 13:29:39 -07:00
Andrew Kelley
e3bb06a984 std.Build.RunStep: show test name on process termination
This is a small change to help when reading failure logs which makes the
"exited with code 1" and similar message include the test name.

Further enhancements could do the following:
 * even if one unit test crashes the process, the parent process
   continues running the other unit tests
 * ability to test for expected panics (#1356)
 * timeouts on individual tests
2023-04-28 13:29:39 -07:00
Andrew Kelley
fee318c44d Sema: fix airMemset for comptime slices 2023-04-28 13:24:43 -07:00
Andrew Kelley
6931f6c5be Sema: fix false negative Value.isComptimePtr for slices 2023-04-28 13:24:43 -07:00
Andrew Kelley
624c3069b4 std.os.windows: fix overlapping copy 2023-04-28 13:24:43 -07:00
Andrew Kelley
0794e48b91 update a couple more callsites to @memset 2023-04-28 13:24:43 -07:00
Andrew Kelley
cb9e8b0d01 C backend: take advantage of Assignment abstraction in airMemset 2023-04-28 13:24:43 -07:00
Andrew Kelley
42973d73e6 compiler: use @memcpy instead of std.mem.copy 2023-04-28 13:24:43 -07:00
Andrew Kelley
125221cce9 std: update to use @memcpy directly 2023-04-28 13:24:43 -07:00
Andrew Kelley
73d3fb9883 C backend: fix ptr comparison of array ptrs when one is null-terminated 2023-04-28 13:24:43 -07:00
Andrew Kelley
6261c13731 update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
Andrew Kelley
57ea6207d3 std.ArrayList: mark the appendNTimes methods inline
The previous commit introduced an optimization to the LLVM backend that
makes `@memset` lower more optimally when the element is comptime-known
and has a repeating byte pattern.

By making these functions inline, if the element parameter is
comptime-known at the callsite, it will be comptime-known in the
`@memset` call, causing more use of the LLVM `memset` intrinsic rather
than an inline for loop when using the LLVM backend.

This affects, for example, std.crypto.argon2, which calls
appendNTimesAssumeCapacity with a `[128]u64` as the element. This is now
lowered with a single `memset` call.
2023-04-28 13:24:43 -07:00
Andrew Kelley
82fc360613 stage2: avoid panicking for unimplemented compiler code
Prevents the compiler from crashing when using `@memset` on extern
unions, for example.
2023-04-28 13:24:43 -07:00
Andrew Kelley
a67dec1c9f disable not yet passing new behavior tests from this branch 2023-04-28 13:24:42 -07:00
Andrew Kelley
36df2a83fc C backend: fix memset for structs and arrays 2023-04-28 13:24:42 -07:00
Andrew Kelley
9295355985 LLVM backend: optimize memset with comptime-known element
When the element is comptime-known, we can check if it has a repeated
byte representation. In this case, `@memset` can be lowered with the
LLVM intrinsic rather than with a loop.
2023-04-28 13:24:42 -07:00
Andrew Kelley
51adbf472b llvm backend: fix memset with byref element value 2023-04-28 13:24:42 -07:00
Andrew Kelley
00b690540e llvm backend: fix lowering of memset
The bitcast of ABI size 1 elements was problematic for some types.
2023-04-28 13:24:42 -07:00
Andrew Kelley
fd6200eda6
Merge pull request #15431 from kcbanner/fix_decl_value_arena
sema: Rework Decl.value_arena to fix another memory corruption issue
2023-04-28 11:43:57 -07:00
Andrew Kelley
011bc59e8a
Merge pull request #15435 from jacobly0/x86_64-frame
x86_64: add frame indices
2023-04-27 15:45:01 -07:00
Andrew Kelley
aa3405aabc
Merge pull request #15474 from Luukdegram/wasm-atomics
wasm: implement atomic instructions
2023-04-27 08:26:35 -07:00
Jacob Young
8c52c6ec6c std: prevent the possibility of deadlocks in some threaded tests 2023-04-27 08:24:32 -07:00
Tw
131b328c10 translate-c: deduplicate global declaration
Fix #15456

Signed-off-by: Tw <weii.tan>
2023-04-27 11:13:16 +03:00
朕与将军解战袍
363269a2a9
fix incorrect struct definition 2023-04-27 11:10:38 +03:00
xEgoist
1a455b2dd8 test: Fix windows_spawn tmp directory cleanup
On Windows, a directory that's set as the current working directory is
not allowed to be removed. This can cause error on `deleteTree` if the
CWD is set to the file to be removed and will cause `error.FileBusy`.
However, due to `tmp.cleanup()` ignoring the errors, the folder removal error will
be ignored. The only test violating this is `windows_spawn`. As a
solution, setting the parent directory to be the CWD before deletion
will allow the cleanup to pass.
2023-04-27 11:01:02 +03:00