14473 Commits

Author SHA1 Message Date
Elaine Gibson
19b6995939 mingw: define _WIN32_WINNT when building CRT 2024-03-20 15:02:04 -07:00
Andrew Kelley
8c94950c24 fix compilation failures found by CI 2024-03-19 16:18:18 -07:00
Andrew Kelley
6b2899df2a compiler: fix wrong detection of rlimit
related to #19352
2024-03-19 11:45:10 -07:00
Andrew Kelley
cd62005f19 extract std.posix from std.os
closes #5019
2024-03-19 11:45:09 -07:00
Robin Voetter
7057bffc14
Merge pull request #19337 from Snektron/spirv-globals
spirv: rework generic global
2024-03-19 09:34:59 +01:00
Robin Voetter
335ff5a5f4
spirv: fix optional comparison 2024-03-18 19:13:50 +01:00
Robin Voetter
8ed134243a
spirv: unused instruction pruning linker pass 2024-03-18 19:13:50 +01:00
Robin Voetter
9b18125562
spirv: make generic globals invocation-local 2024-03-18 19:13:50 +01:00
Robin Voetter
20d7bb68ac
spirv: add zig-specific ext inst
This may be removed again in the future...
2024-03-18 19:13:49 +01:00
Robin Voetter
e566158acf
spirv: make IdResult an enum 2024-03-18 19:13:49 +01:00
Robin Voetter
9b058117f0
spirv: update assembler with new spec 2024-03-18 19:13:48 +01:00
Robin Voetter
028f532dc0
spirv: update spec to SPIRV-Headers/8b246ff
We need this "unstable" version to get the Zig identifiers.
2024-03-18 19:13:47 +01:00
SuperAuguste
8e7d9afdac Add 64bit byteswap case, use fewer locals 2024-03-18 12:40:41 +01:00
Veikka Tuominen
64173dadca
Merge pull request #19334 from antlilja/llvm-fast-math
Fix setFloatMode in LLVM backend
2024-03-18 04:27:39 +02:00
kcbanner
54f6e74cda cbe: rework StringLiteral to decide between string literal or array initializator syntax
This fixes an issue with boostrapping the compiler using MSVC. There is a CircularBuffer with
an array of length 65536 initialized to undefined, and because the undefined path of `renderValue`
was using `StringLiteral` to render this, the resulting zig2.c would fail to compile using MSVC.

The solution was to move the already-existing array initializer path (used in the non-undefined path)
into StringLiteral, and make StringLiteral aware of the total length so it could decide between which
style of initialization to use. We prefer to use string literals if we can, as this results in the least
amount of emitted C source.
2024-03-17 16:17:04 -07:00
Andrew Kelley
95cb939440
Merge pull request #19333 from Vexu/fixes
Miscellaneous error fixes
2024-03-17 15:26:55 -07:00
Andrew Kelley
d981549d65
Merge pull request #19323 from jacobly0/rm-fn-type-align
AstGen: disallow alignment on function types
2024-03-17 15:19:54 -07:00
antlilja
79b868d504 LLVM: Use fast math when requested 2024-03-17 16:26:28 +01:00
antlilja
b20cee586c LLVM: Fix incorrect fast constant in FastMath packed struct 2024-03-17 16:25:59 +01:00
antlilja
37a4d9391f LLVM: Fix reaching unreachable code when emitting fast call 2024-03-17 16:23:14 +01:00
Robin Voetter
3bffa58012
Revert "spirv: merge construct(Struct/Vector/Array) into constructComposite"
This reverts commit eb2d61d02e503f01070c05e2e1fc87e827124d94.
2024-03-17 14:17:26 +01:00
Veikka Tuominen
436c72e89a Sema: allow param instructions to clobber inst_map
Closes #18840
2024-03-17 14:42:12 +02:00
Veikka Tuominen
fec4b7ef5c Sema: fix spurious type has no namespace error
Closes #19232
2024-03-17 14:42:12 +02:00
Veikka Tuominen
f983adfc10 Sema: fix printing of inferred error set of generic fn
Closes #19332
2024-03-17 13:33:05 +02:00
Anton Lilja
294f51814f
LLVM lowerDebugType: Lower union types without a layout into an empty namespace 2024-03-17 13:25:09 +02:00
Jacob Young
e646e01161 Revert "back out the build_runner.zig moving change"
This reverts commit 1a01151a4e1e83826d6911c929210aabcaed36e9 in
preparation for a zig1.wasm update.
2024-03-17 03:06:39 +01:00
Jacob Young
d10c52c194 AstGen: disallow alignment on function types
A pointer type already has an alignment, so this information does not
need to be duplicated on the function type.  This already has precedence
with addrspace which is already disallowed on function types for this
reason.  Also fixes `@TypeOf(&func)` to have the correct addrspace and
alignment.
2024-03-17 03:06:17 +01:00
Andreas Herrmann
dbb11915bd Fix "unable to generate DLL import .lib file"
Closes https://github.com/ziglang/zig/issues/19284

As of 9f2cb920c055bc990cc9d593b8dc9eaa450d07b9 configuring the global
cache directory to a relative path causes errors of the following form
when cross compiling to `windows-gnu`.
```
error: unable to generate DLL import .lib file for kernel32: FileNotFound
```

The issue occurred because the `def_final_path` included the global
cache path as a prefix and later on the `def_final_file` was created
using that path with the global cache directory handle.
2024-03-16 13:33:36 +02:00
zhylmzr
fe61b19b96 macos: archive size fix
fixed: #19154
2024-03-16 07:33:18 +01:00
Andrew Kelley
ce4245f873
Merge pull request #19312 from mikdusan/bsd-debitrot
bsd: debitrot
2024-03-15 16:59:05 -07:00
Jakub Konka
d565c5dfcd macho: fix a sad typo in calculating the address of a TLV pointer 2024-03-15 08:17:10 +01:00
Michael Dusan
5ce40e61c6
bsd: debitrot AtomicOrder renames
- complete std.builtin.AtomicOrder renames that were missed from 6067d39522f
2024-03-15 02:28:50 -04:00
Elaine Gibson
6b38758594 coff: only store PDB basename 2024-03-14 18:56:02 -07:00
Matthew Lugg
39459e78ad
Merge pull request #19273 from mlugg/incremental-some-more
compiler: more progress on incremental
2024-03-14 17:45:21 +00:00
Motiejus Jakštys
400145ee3b reduce garbage for repeated zig cc - calls
Context: user provides `-` to read from stdin instead of a file.

Before: it would create a file in $ZIG_LOCAL_CACHE_DIR/tmp/ for each
invocation and leave it there.
After: it hashes the file contents and renames the file to the hash.

Result: repeated invocations of `zig cc` do not cause so much trash to
be created.
2024-03-14 09:32:56 -07:00
mlugg
7c32370194
Zcu: preserve ordering of usingnamespace decls
See comment. This slightly regresses a previous fix from this branch. A
proper solution will come soon, with the splitting up of `Decl` into
`Cau` and `Nav`.
2024-03-14 07:40:08 +00:00
mlugg
347196f905
Zcu: perform orphan checks against uncoerced function 2024-03-14 07:40:08 +00:00
mlugg
075c103332
compiler: add func_ies incremental dependencies
This was an oversight in my original design. This new form of dependency
is invalidated when the resolved IES for a runtime function changes.
2024-03-14 07:40:08 +00:00
mlugg
1421d329a3
compiler: progress towards incremental
Most basic re-analysis logic is now in place. Trivial updates are
hitting linker assertions.
2024-03-14 07:40:07 +00:00
mlugg
7ba8641d19
Zcu: handle updates to file root struct 2024-03-14 07:40:07 +00:00
mlugg
42fedb3f6c
Zcu: handle incremental updates (more) correctly when scanning namespaces 2024-03-14 07:40:06 +00:00
mlugg
d4ce1ec8dd
Zcu: convert Decl.zir_inst_index to a TrackedInst.Index.Optional
This makes tracking easier across incremental updates: `scanDecl` can
now tell whether an existing decl in a namespace was mapped to the one
it's analyzing in the new ZIR.
2024-03-14 07:40:06 +00:00
mlugg
7c4793f23c
Zcu: remove old decls after scanning namespace 2024-03-14 07:40:06 +00:00
mlugg
48af67c152
Zcu: rename implicitly-named decls to avoid overriding by explicit decls 2024-03-14 07:40:05 +00:00
mlugg
00969062a9
compiler: detect duplicate test names in AstGen
There is no reason to perform this detection during semantic analysis.
In fact, doing so is problematic, because we wish to utilize detection
of existing decls in a namespace in incremental compilation.
2024-03-14 07:40:05 +00:00
Jakub Konka
55c085b893 elf: re-use output buffer for emitting thunks 2024-03-12 13:25:29 +01:00
Jakub Konka
faa4bdb017 elf+aarch64: fix off-by-one in converging on groups interleaved with thunks 2024-03-12 13:16:11 +01:00
Jakub Konka
b1eba5a996 elf+aarch64: actually write out thunks, and add a proper link test 2024-03-12 13:16:11 +01:00
Andrew Kelley
bd24e66379
Merge pull request #19229 from tiehuis/ryu-128
std.fmt: add ryu floating-point formatting implementation
2024-03-11 18:46:26 -07:00
Andrew Kelley
0c61466771
Merge pull request #19174 from squeek502/lazy-resinator
Lazily compile the `zig rc` subcommand and use it during `zig build-exe`, etc
2024-03-11 17:18:09 -07:00