Commit Graph

31476 Commits

Author SHA1 Message Date
mlugg
51706af908
compiler: introduce new CallingConvention
This commit begins implementing accepted proposal #21209 by making
`std.builtin.CallingConvention` a tagged union.

The stage1 dance here is a little convoluted. This commit introduces the
new type as `NewCallingConvention`, keeping the old `CallingConvention`
around. The compiler uses `std.builtin.NewCallingConvention`
exclusively, but when fetching the type from `std` when running the
compiler (e.g. with `getBuiltinType`), the name `CallingConvention` is
used. This allows a prior build of Zig to be used to build this commit.
The next commit will update `zig1.wasm`, and then the compiler and
standard library can be updated to completely replace
`CallingConvention` with `NewCallingConvention`.

The second half of #21209 is to remove `@setAlignStack`, which will be
implemented in another commit after updating `zig1.wasm`.
2024-10-19 19:08:59 +01:00
mlugg
8573836892
incremental: disable flaky test 2024-10-18 09:46:03 +01:00
mlugg
097766bba3 compiler: implement @FieldType
Resolves: #21702
2024-10-18 08:50:40 +01:00
Andrew Kelley
fffbb511db
Merge pull request #21736 from alexrp/qemu-9.1
ci: Update to QEMU 9.1.0 in x86_64-linux scripts
2024-10-17 19:50:42 -07:00
Alex Rønne Petersen
8bfc36f091
ci: Update to QEMU 9.1.0 in x86_64-linux scripts. 2024-10-18 00:55:20 +02:00
Alex Rønne Petersen
b113415871
ci: Remove -fwasmtime from aarch64-linux scripts.
This is covered by the x86_64-linux scripts. Also remove the TODO comments
related to -fqemu for the same reason.
2024-10-18 00:55:18 +02:00
Alex Rønne Petersen
ff594eae49 std.Target: Make Abi.default() more smarter.
This builds on 221bd829bc with more research I did
for test/llvm_targets.zig.
2024-10-18 00:10:43 +02:00
Andrew Kelley
8504e1f550
Merge pull request #21610 from alexrp/riscv-abis
Fix some RISC-V ABI issues and add ILP32/LP64 (soft float) to module tests
2024-10-17 12:54:44 -07:00
wooster0
816dfca0b5 langref: update builtin variadic functions
Documentation was outdated.
2024-10-17 11:51:06 +03:00
Alex Rønne Petersen
d38ed893c6
Merge pull request #21726 from alexrp/target-api
`std.Target`: Some miscellaneous API improvements
2024-10-17 02:49:34 +02:00
Justin Braben
4a2a0f50ca
fix compilation errors for fs and fs.Dir (#21643)
* fix compilation errors for fs and fs.Dir

* mem.span instead of mem.sliceTo

* Updating symLinkAbsoluteW function parameters

* Update with expected rename semantics
2024-10-17 01:08:58 +02:00
Alex Rønne Petersen
549a7eba40
std.Target: Rename OS version range functions to drop the "get" prefix. 2024-10-16 22:25:29 +02:00
Alex Rønne Petersen
55fe86c57e
std.Target: Remove isBpfFreestanding().
The only use of this has nothing to do with the OS tag.
2024-10-16 22:25:20 +02:00
Alex Rønne Petersen
140fb615a6
std.Target: Move isLib{C,Cxx}LibName() to std.zig.target.
These are really answering questions about the Zig compiler's capacity to
provide a libc/libc++ implementation. As such, std.zig.target seems like a more
fitting place for these.
2024-10-16 22:25:13 +02:00
Alex Rønne Petersen
bdb00b393e
std.Target: Only consider libxnet to be a libc library name for musl.
glibc has never had this.
2024-10-16 22:24:57 +02:00
Alex Rønne Petersen
879a39a700
std.Target: Ignore case for all Darwin platforms in isLibCLibName().
Matches isLibCxxLibName() behavior.
2024-10-16 22:24:52 +02:00
Alex Rønne Petersen
c76a98f28a
std.Target: Rename is_lib{c,cxx}_lib_name() to isLib{C,Cxx}LibName(). 2024-10-16 22:24:46 +02:00
Alex Rønne Petersen
482759079f
std.Target: Move the elfiamcu check under the x86 prong in toElfMachine(). 2024-10-16 22:24:38 +02:00
Matthew Lugg
6201031e05
Merge pull request #21722 from mlugg/incremental
incremental compilation progress
2024-10-16 20:29:55 +01:00
mlugg
3ba4f86198
incremental: disable failing test
The previous commit exposed a linker bug.
2024-10-16 16:30:38 +01:00
mlugg
22539783ad
incremental: introduce file dependencies to handle AstGen failures
The re-analysis here is a little coarse; it'd be nice in the future to
have a way for an AstGen failure to preserve *all* analysis which
depends on the last success, and just hide the compile errors which
depend on it somehow. But I'm not sure how we'd achieve that, so this
works fine for now.

Resolves: #21223
2024-10-16 16:30:36 +01:00
mlugg
c6842b58d4
Zcu: cache output of resolveReferences between calls
This not only simplifies the error bundling logic, but also improves
efficiency by allowing the result to be cached between, for instance,
multiple calls to `totalErrorCount`.
2024-10-16 16:30:36 +01:00
mlugg
a7dd34bfc5
incremental: add new test case
This isn't exactly the case provided in #11290, but is a slightly
simpler case which I know would have triggered the same bug in the old
implementation of incremental compilation.

Resolves: #11290
2024-10-16 14:22:33 +01:00
Alex Rønne Petersen
bdd3bc056e
Merge pull request #21715 from alexrp/loongarch-porting
Some miscellaneous LoongArch port work
2024-10-16 09:13:51 +02:00
Alex Rønne Petersen
ecd5878b74
Merge pull request #21714 from alexrp/target-cpu-baseline
`std.Target`: Make `Cpu.baseline()` take OS into consideration and pick a better CPU for Apple targets
2024-10-16 04:59:02 +02:00
Alex Rønne Petersen
7a3626d1c6
llvm: Disable f16 lowering for loongarch.
This should be reverted with LLVM 20.
2024-10-16 01:19:00 +02:00
Alex Rønne Petersen
5e4249eb8b
llvm: Fix natural int width specifications for loongarch in DataLayoutBuilder. 2024-10-16 01:10:36 +02:00
Alex Rønne Petersen
95674fca0c
std.Thread: Use loongarch freeAndExit() implementation for loongarch32 too. 2024-10-16 01:10:36 +02:00
Alex Rønne Petersen
1cdb143af2
std.Target: Fix loongarch32 handling in C type alignment calculation. 2024-10-16 01:10:36 +02:00
Alex Rønne Petersen
dd983e12aa
compiler-rt: Use loongarch clear_cache() implementation for loongarch32 too. 2024-10-16 01:10:35 +02:00
Alex Rønne Petersen
f5beb50619
test: Remove some loongarch32 triples that were erroneously added to llvm_targets.
glibc and musl do not support loongarch32 yet.
2024-10-16 01:10:35 +02:00
Alex Rønne Petersen
a2c466220c
std.Target: Make Cpu.baseline() pick a better CPU for Apple targets. 2024-10-16 00:33:40 +02:00
Alex Rønne Petersen
1efc9c149c std.zig.target: Sort the target triple list in a more user-friendly way.
This order should be a bit closer to what a user would expect when running
`zig targets | jq -r .libc[]` or similar.
2024-10-16 00:33:23 +02:00
Alex Rønne Petersen
1bca53cc20
std.Target: Change Cpu.baseline() to also be able to take OS into consideration. 2024-10-16 00:33:10 +02:00
Alex Rønne Petersen
6302a90cbf
test: Add riscv(32,64)-linux-(none,musl) with soft float to module tests. 2024-10-15 20:25:26 +02:00
Alex Rønne Petersen
0941364d70
compiler-rt: Always use f16 as the half type for riscv. 2024-10-15 19:29:56 +02:00
Alex Rønne Petersen
958f57d65d
llvm: Enable native f16 lowering for riscv32. 2024-10-15 19:29:56 +02:00
Alex Rønne Petersen
3550cacd73
llvm: Fix compiler crash when lowering f16 for riscv32 ilp32. 2024-10-15 19:29:56 +02:00
Alex Rønne Petersen
d289dba125
llvm: Fix ilp32e/lp64e and ilp32f/lp64f ABI selection for riscv. 2024-10-15 19:29:56 +02:00
gabeuehlein
7b8fc18c66
Sema: fail if analyzing return in noreturn-declared function before coercing undefined
Just switches logic around in coerceExtra to check for returning in a noreturn function before coercing undefined to anything
2024-10-14 15:02:14 +03:00
Andrew Kelley
9fd61f7460 std.MultiArrayList: add clear methods 2024-10-14 03:33:23 -07:00
Andrew Kelley
3bf89f55c2
Merge pull request #21682 from der-teufel-programming/remove-packedintarray
Remove PackedIntArray
2024-10-13 18:46:51 -07:00
tgschultz
ba569bb8e9
Rewrite bit_reader and bit_writer to take advantage of current zig semantics and enhance readability (#21689)
Co-authored-by: Tanner Schultz <tgschultz@tgschultz-dl.tail7ba92.ts.net>
2024-10-13 18:44:42 -07:00
Robin Voetter
e2e79960d2
Merge pull request #21688 from Snektron/spirv-fix
spirv: fix some bitrot
2024-10-13 22:33:03 +02:00
Alex Rønne Petersen
7185ccad14
Merge pull request #21686 from alexrp/glibc-fixes
`glibc`: Emit some fill data for stub symbols, thus giving each a unique address.
2024-10-13 13:00:00 +02:00
David Rubin
e131a2c8e2
implement packed struct equality (#21679) 2024-10-12 20:59:12 -07:00
Robin Voetter
86b88ea7da
spirv: skip range switch tests
This is not yet implemented
2024-10-13 01:58:11 +02:00
Robin Voetter
c1132edd53
spirv: don't generate OpUnreachable after noreturn call
It seems that these are now automatically added to AIR in Sema.
2024-10-13 01:57:35 +02:00
Robin Voetter
973f846251
spirv: implement repeat and dbg_arg_inline 2024-10-13 01:57:06 +02:00
Robin Voetter
3cd19b8884
spirv: don't try to lower types which have no runtime bits 2024-10-13 01:56:33 +02:00