26268 Commits

Author SHA1 Message Date
Andrew Kelley
b6762c2473 Sema: fix crash when ref coercion dest is var args
When analyzing the `validate_ref_ty` ZIR instruction, an assertion would
trip if the result type was a var args function argument. The fix is the
same as e6b73be870a39f4da7a08a40da23e38b5e9613da - inline the logic of
`resolveType` and handle the case of var args.

Closes #17494
2023-10-13 00:31:22 -07:00
Andrew Kelley
e6b73be870 Sema: fix crash when coercion dest is var args
When analyzing the `as` ZIR instruction, an assertion would trip if the
result type was a var args function argument. The fix is simple: inline
a little bit of the `resolveType` logic into `analyzeAs` to make it
detect this situation - which it was already attempting to do.

Closes #16197
2023-10-12 22:03:39 -07:00
Ryan Liptak
2769215b90 Add zig rc subcommand, a drop-in replacement for rc.exe
Uses resinator under-the-hood (see https://github.com/ziglang/zig/pull/17069)

Closes #9564
2023-10-12 16:19:34 -07:00
Koakuma
375bb5f4a1 lib: Fix asm code in _start for SPARC
SPARCs have delayed branches, that is, it will unconditionally
run the next instruction following a branch.
Slightly reorder the _start code sequence to prevent it from
accidentally executing stray instructions, which may result in odd
program behavior.
2023-10-12 16:13:32 -07:00
Andrew Kelley
67ee68fc9e
Merge pull request #17498 from ziglang/fix-fetch
path-related fixes for Package.Fetch and Package.Manifest
2023-10-12 15:48:16 -07:00
JustinWayland
b37fdf387a Fix minor typo in the description of Progress 2023-10-13 00:44:30 +03:00
Andrew Kelley
b9f75a39d3 Package.Manifest: fix error message for paths
closes #17491
2023-10-12 10:47:22 -07:00
Andrew Kelley
1d1e5a8617 Package.Fetch: fix empty path and "." not including all
Related to #17491
2023-10-12 10:47:22 -07:00
Kai Jellinghaus
2254882ebe Fix compilation failure in valgrind.zig 2023-10-12 10:17:49 -07:00
Krzysztof Wolicki
8c6b0271cc Package.Fetch: wrap operations involving tmp_directory in a block
This makes tmp_directory close before calling renameTmpIntoCache which fixes occurences of those AccessDenied errors that aren't synonymous with PathAlreadyExists on Windows
2023-10-11 20:28:07 -07:00
Alexander Heinrich
4e188dd66c Update docs of PriorityQueue.iterator() and PriorityDeque.iterator() 2023-10-12 04:48:22 +03:00
Andrew Kelley
1302274910 move two TODO comments to a github issue 2023-10-11 11:40:13 -07:00
Andrew Kelley
f80ca1d66a disable flaky test 2023-10-11 11:35:51 -07:00
Andrew Kelley
5722261e64
Merge pull request #17465
Compilation: default to self-hosted backends when not using libllvm
2023-10-11 00:53:07 -07:00
Ryan Liptak
42998e637b Package: Fix path separator not being escaped between root_dir and sub_path
Fixes a package fetching regression on Windows. Closes #17477
2023-10-10 23:02:03 -07:00
mlugg
1033d71017 Sema,type: unify type query functions
The following pairs of functions have been combined using the "advanced"
pattern used for other type queries:

* `Sema.fnHasRuntimeBits`, `Type.isFnOrHasRuntimeBits`
* `Sema.typeRequiresComptime`, `Type.comptimeOnly`
2023-10-10 21:40:23 -07:00
Krzysztof Wolicki
7edba14d7c
Step.Run: change cwd to ?Build.LazyPath (#17418)
closes #17409
2023-10-10 18:39:44 -04:00
Krzysztof Wolicki
7abf9b3a83
Step.Compile: add options struct for addCSourceFiles (#17420)
Closes #17410
2023-10-10 14:29:26 -04:00
Andrew Kelley
da7e4fb31a revert compiler_rt: no need to put it in a static library
This mostly reverts 6e0904504155d3cba80955c108116170fd739aec however it
leaves intact the linker supporting both obj and lib files, and the
frontend choosing which one to create.
2023-10-10 11:23:39 -07:00
Jakub Konka
33ef01d16b macho: test for presence of _abc as export in 16308 test 2023-10-10 11:17:29 -07:00
Andrew Kelley
8679c7a607 Compilation: default to self-hosted backend when not using libllvm
When not using libllvm, it means the compiler is not capable of
producing an object file or executable, making the self-hosted backends
be a better default.
2023-10-10 11:17:29 -07:00
Andrew Kelley
6e09045041 compiler_rt: no need to put it in a static library
It's simpler to link against compiler_rt.o directly.
2023-10-10 11:17:29 -07:00
Andrew Kelley
2ca7cc46c4 Package.Fetch: fix inclusions not working for directories
Oops, the loop was checking the wrong variable! Added a unit test.
2023-10-10 02:29:29 -07:00
Andrew Kelley
aaf46187ab
Merge pull request #17391 from xxxbxxx/load-i4
codegen/llvm: truncate padding bits when loading a non-byte-sized value
2023-10-09 22:06:49 -07:00
Andrew Kelley
fa08e49f83 Package.Fetch: allow relative paths outside project root
Only for packages that come from the main package. Fetched packages
still cannot depend on paths outside their package root.
2023-10-09 22:01:18 -07:00
Veikka Tuominen
b2c36b14de Sema: fix dbg_inline instructions not being emitted
This broke with #16604 but went unnoticed due to lack of tests.
Closes #17444
2023-10-09 21:00:31 -07:00
Eric Joldasov
1f6d82ec01 std.cstr: remove deprecated namespace
Followup to 0a868dacdd31b7d5c529a332da718683477a2505 .

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-10-10 02:08:03 +03:00
Jonathan Marler
3a47bc7154 Grammar: Use ContainerDeclaration* instead of ContainerDeclarations
`ContainerDeclarations` is an abstraction of `ContainerDeclaration*`.
Removing this abstraction allows the `ContainerMembers` rule to contain
more concrete information without having to look at the definition
of `ContainerDeclarations`.
2023-10-10 00:51:58 +03:00
Jacob Young
9e341a6da3
Merge pull request #17447 from jacobly0/x86_64
x86_64: fix codegen errors when compiling compiler_rt
2023-10-09 16:18:50 -04:00
Andrew Kelley
f7bc55c013
Merge pull request #17392 from ziglang/fetch
rework package manager
2023-10-09 11:47:37 -07:00
Karl Seguin
75b48ef503
std.mem: use indexOfScalarPos when indexOf is called where needle.len == 1
When `std.mem.indexOf` is called with a single-item needle, use `indexOfScalarPos` which is significantly faster than the more general `indexOfPosLinear`.  This can be done without introducing overhead to normal cases (where `needle.len > 1`).
2023-10-09 16:50:16 +03:00
Pat Tullmann
57874ce619
lib/std/fs/test.zig: cleanup (#17443)
* fs/test.zig: use arena allocator more consistently

* fs/test.zig: remove unnecessary type information

Zig can (now?) implicitly cast a `&.{ "foo"}` when passed to
`fs.path.join()`, so the `[_][]const u8` is unnecessary.

* fs/test.zig: Use fs.path.join() for longer paths

Replace long path constructions (that use several "++ path_sep ++")
with a single call to `fs.path.join`.  Seems more readable to me.

* fs/test.zig: fmt
2023-10-09 16:44:14 +03:00
Jacob Young
922b5b5453 x86_64: implement 128-bit integer multiply and divide 2023-10-09 05:23:23 -04:00
Jacob Young
d559c61902 x86_64: implement @min and @max for 128-bit integers 2023-10-09 03:11:41 -04:00
Jacob Young
21948d7540 x86_64: implement @abs of 128-bit integers 2023-10-09 03:11:41 -04:00
Jacob Young
a96c08c1d1 x86_64: implement struct field value for register pairs 2023-10-09 03:11:40 -04:00
Jacob Young
f28b1657aa x86_64: implement 128-bit integer shifts in registers 2023-10-09 03:09:01 -04:00
Andrew Kelley
95907cb795 restore progress reporting for package fetching 2023-10-08 21:14:30 -07:00
Andrew Kelley
5eb5d523b5 give modules friendly names for error reporting 2023-10-08 20:58:04 -07:00
Andrew Kelley
cd4397783f Package.Fetch: improved deletion algorithm
Instead of every file deletion being followed by a recursive attempt to
remove the parent directory, while walking the directory, every
directory that will have nonzero files deleted from it is tracked in an
array hash map.

After all the threads have finished deleting and hashing, the parent
thread sorts the "suspicious" directories by length, descending,
ensuring that children appear before parents, and then iterates over the
array hash map, attempting a rmdir operation on each. Any rmdir that
succeeds appends the parent directory to the map so that it will be
removed if empty.
2023-10-08 20:03:40 -07:00
Andrew Kelley
4a2cf38844 Package.Fetch: apply inclusion rules from build.zig.zon 2023-10-08 19:29:17 -07:00
Andrew Kelley
efbfa8ef3e std.fs.path.resolve: add test cases for empty string
Since I'm about to rely on this behavior.
2023-10-08 19:18:21 -07:00
Andrew Kelley
1b372f1872 fix using the wrong allocator for modules 2023-10-08 18:23:38 -07:00
Andrew Kelley
5e7c44a321 Package.Fetch: tighten up check for path outside root 2023-10-08 17:42:49 -07:00
Andrew Kelley
6d84caf727 move some package management related source files around 2023-10-08 17:29:55 -07:00
Andrew Kelley
7bae6d9064 fix dependencies.zig generation with no dependencies 2023-10-08 17:26:02 -07:00
Andrew Kelley
8f20ce74f4 zig fetch: require 'paths' field in the manifest 2023-10-08 17:21:18 -07:00
Andrew Kelley
f0cc6f17a0 Package.Fetch: fix not making directory paths for symlinks 2023-10-08 17:21:08 -07:00
Andrew Kelley
f48ec4b8ee use long-lived arena for @cImport-generated Module 2023-10-08 16:54:31 -07:00
Andrew Kelley
1ad33f53fe give build.zig modules access to their dependencies' build.zig modules 2023-10-08 16:54:31 -07:00