@zigc/lib 0.16.0 → 0.17.0-dev.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/c/fcntl.zig +6 -1
- package/c/inttypes.zig +0 -10
- package/c/math.zig +46 -122
- package/c/pthread.zig +57 -0
- package/c/search.zig +1 -27
- package/c/stdlib/drand48.zig +0 -57
- package/c/stdlib.zig +0 -100
- package/c/string.zig +20 -7
- package/c/strings.zig +0 -38
- package/c/unistd.zig +27 -26
- package/c/wchar.zig +10 -0
- package/c.zig +2 -2
- package/compiler/aro/aro/CodeGen.zig +5 -6
- package/compiler/aro/aro/Compilation.zig +17 -14
- package/compiler/aro/aro/Driver.zig +14 -13
- package/compiler/aro/aro/Parser.zig +20 -15
- package/compiler/aro/aro/Pragma.zig +3 -2
- package/compiler/aro/aro/Preprocessor.zig +9 -6
- package/compiler/aro/aro/pragmas/message.zig +3 -2
- package/compiler/aro/aro/text_literal.zig +3 -2
- package/compiler/aro/assembly_backend/x86_64.zig +4 -4
- package/compiler/build_runner.zig +0 -2
- package/compiler/reduce/Walk.zig +7 -7
- package/compiler/test_runner.zig +2 -2
- package/compiler/translate-c/Translator.zig +6 -2
- package/compiler/translate-c/main.zig +1 -1
- package/compiler_rt/cos.zig +0 -2
- package/compiler_rt/divmodei4.zig +40 -17
- package/compiler_rt/exp.zig +1 -6
- package/compiler_rt/exp2.zig +1 -6
- package/compiler_rt/exp_f128.zig +377 -0
- package/compiler_rt/fabs.zig +0 -2
- package/compiler_rt/fma.zig +0 -2
- package/compiler_rt/fmax.zig +0 -2
- package/compiler_rt/fmin.zig +0 -2
- package/compiler_rt/fmod.zig +0 -2
- package/compiler_rt/limb64.zig +876 -15
- package/compiler_rt/log.zig +0 -2
- package/compiler_rt/log10.zig +0 -2
- package/compiler_rt/log2.zig +0 -2
- package/compiler_rt/mulXi3.zig +1 -1
- package/compiler_rt/round.zig +0 -2
- package/compiler_rt/sin.zig +0 -2
- package/compiler_rt/sincos.zig +0 -2
- package/compiler_rt/sqrt.zig +0 -2
- package/compiler_rt/ssp.zig +1 -1
- package/compiler_rt/tan.zig +0 -2
- package/compiler_rt/trunc.zig +0 -2
- package/compiler_rt/udivmodei4.zig +28 -0
- package/fuzzer.zig +2 -0
- package/libc/include/aarch64-linux-any/asm/hwcap.h +1 -0
- package/libc/include/aarch64-linux-any/asm/unistd_64.h +1 -0
- package/libc/include/any-linux-any/asm-generic/errno.h +2 -0
- package/libc/include/any-linux-any/asm-generic/unistd.h +4 -1
- package/libc/include/any-linux-any/drm/amdgpu_drm.h +20 -6
- package/libc/include/any-linux-any/drm/amdxdna_accel.h +8 -0
- package/libc/include/any-linux-any/drm/drm_fourcc.h +6 -6
- package/libc/include/any-linux-any/drm/panfrost_drm.h +75 -1
- package/libc/include/any-linux-any/drm/panthor_drm.h +154 -3
- package/libc/include/any-linux-any/drm/rocket_accel.h +74 -24
- package/libc/include/any-linux-any/drm/xe_drm.h +89 -6
- package/libc/include/any-linux-any/linux/android/binder.h +1 -1
- package/libc/include/any-linux-any/linux/bpf.h +28 -0
- package/libc/include/any-linux-any/linux/btrfs.h +1 -0
- package/libc/include/any-linux-any/linux/btrfs_tree.h +32 -2
- package/libc/include/any-linux-any/linux/dma-buf.h +1 -0
- package/libc/include/any-linux-any/linux/dpll.h +1 -0
- package/libc/include/any-linux-any/linux/elf.h +2 -0
- package/libc/include/any-linux-any/linux/ethtool.h +21 -5
- package/libc/include/any-linux-any/linux/fs.h +1 -0
- package/libc/include/any-linux-any/linux/hyperv.h +1 -1
- package/libc/include/any-linux-any/linux/idxd.h +134 -134
- package/libc/include/any-linux-any/linux/if_alg.h +1 -1
- package/libc/include/any-linux-any/linux/if_link.h +1 -0
- package/libc/include/any-linux-any/linux/input-event-codes.h +4 -0
- package/libc/include/any-linux-any/linux/io_uring/bpf_filter.h +68 -0
- package/libc/include/any-linux-any/linux/io_uring/query.h +5 -1
- package/libc/include/any-linux-any/linux/io_uring.h +33 -2
- package/libc/include/any-linux-any/linux/iommufd.h +39 -0
- package/libc/include/any-linux-any/linux/kfd_ioctl.h +13 -3
- package/libc/include/any-linux-any/linux/kfd_sysfs.h +2 -1
- package/libc/include/any-linux-any/linux/kvm.h +30 -6
- package/libc/include/any-linux-any/linux/landlock.h +22 -8
- package/libc/include/any-linux-any/linux/magic.h +1 -0
- package/libc/include/any-linux-any/linux/mempolicy.h +3 -0
- package/libc/include/any-linux-any/linux/mount.h +11 -2
- package/libc/include/any-linux-any/linux/mptcp_pm.h +1 -1
- package/libc/include/any-linux-any/linux/mshv.h +2 -0
- package/libc/include/any-linux-any/linux/netfilter_bridge.h +5 -4
- package/libc/include/any-linux-any/linux/netfilter_ipv4.h +4 -5
- package/libc/include/any-linux-any/linux/netfilter_ipv6.h +3 -4
- package/libc/include/any-linux-any/linux/nfs.h +1 -1
- package/libc/include/any-linux-any/linux/nfsd_netlink.h +1 -0
- package/libc/include/any-linux-any/linux/nilfs2_api.h +2 -2
- package/libc/include/any-linux-any/linux/nilfs2_ondisk.h +97 -66
- package/libc/include/any-linux-any/linux/nl80211.h +104 -3
- package/libc/include/any-linux-any/linux/pci.h +7 -0
- package/libc/include/any-linux-any/linux/pci_regs.h +65 -6
- package/libc/include/any-linux-any/linux/pcitest.h +1 -0
- package/libc/include/any-linux-any/linux/perf_event.h +24 -3
- package/libc/include/any-linux-any/linux/pkt_sched.h +1 -0
- package/libc/include/any-linux-any/linux/prctl.h +30 -0
- package/libc/include/any-linux-any/linux/rseq.h +62 -5
- package/libc/include/any-linux-any/linux/shm.h +0 -1
- package/libc/include/any-linux-any/linux/stddef.h +4 -0
- package/libc/include/any-linux-any/linux/sysctl.h +1 -2
- package/libc/include/any-linux-any/linux/taskstats.h +12 -1
- package/libc/include/any-linux-any/linux/tcp.h +23 -3
- package/libc/include/any-linux-any/linux/typelimits.h +8 -0
- package/libc/include/any-linux-any/linux/ublk_cmd.h +120 -1
- package/libc/include/any-linux-any/linux/v4l2-controls.h +63 -0
- package/libc/include/any-linux-any/linux/vbox_vmmdev_types.h +2 -2
- package/libc/include/any-linux-any/linux/vduse.h +80 -5
- package/libc/include/any-linux-any/linux/version.h +3 -3
- package/libc/include/any-linux-any/linux/vfio.h +4 -0
- package/libc/include/any-linux-any/linux/videodev2.h +3 -0
- package/libc/include/any-linux-any/linux/virtio_ring.h +1 -2
- package/libc/include/any-linux-any/linux/vmclock-abi.h +20 -0
- package/libc/include/any-linux-any/rdma/bnxt_re-abi.h +16 -0
- package/libc/include/any-linux-any/rdma/ib_user_ioctl_cmds.h +16 -0
- package/libc/include/any-linux-any/rdma/mana-abi.h +3 -0
- package/libc/include/any-linux-any/scsi/scsi_bsg_ufs.h +8 -9
- package/libc/include/any-linux-any/sound/sof/tokens.h +6 -0
- package/libc/include/arc-linux-any/asm/swab.h +0 -63
- package/libc/include/arc-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/arm-linux-any/asm/ptrace.h +0 -9
- package/libc/include/arm-linux-any/asm/unistd-eabi.h +1 -0
- package/libc/include/arm-linux-any/asm/unistd-oabi.h +1 -0
- package/libc/include/csky-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/hexagon-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/loongarch-linux-any/asm/hwcap.h +1 -0
- package/libc/include/loongarch-linux-any/asm/kvm.h +1 -0
- package/libc/include/loongarch-linux-any/asm/kvm_para.h +1 -0
- package/libc/include/loongarch-linux-any/asm/unistd_32.h +2 -0
- package/libc/include/loongarch-linux-any/asm/unistd_64.h +2 -0
- package/libc/include/m68k-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/mips-linux-any/asm/errno.h +2 -0
- package/libc/include/mips-linux-any/asm/unistd_n32.h +1 -0
- package/libc/include/mips-linux-any/asm/unistd_n64.h +1 -0
- package/libc/include/mips-linux-any/asm/unistd_o32.h +1 -0
- package/libc/include/powerpc-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/powerpc-linux-any/asm/unistd_64.h +1 -0
- package/libc/include/riscv-linux-any/asm/hwprobe.h +4 -0
- package/libc/include/riscv-linux-any/asm/kvm.h +3 -0
- package/libc/include/riscv-linux-any/asm/ptrace.h +37 -0
- package/libc/include/riscv-linux-any/asm/sigcontext.h +1 -0
- package/libc/include/riscv-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/riscv-linux-any/asm/unistd_64.h +1 -0
- package/libc/include/s390x-linux-any/asm/unistd_64.h +1 -0
- package/libc/include/sparc-linux-any/asm/errno.h +2 -0
- package/libc/include/sparc-linux-any/asm/ioctls.h +4 -4
- package/libc/include/sparc-linux-any/asm/unistd_32.h +2 -0
- package/libc/include/sparc-linux-any/asm/unistd_64.h +2 -0
- package/libc/include/x86-linux-any/asm/auxvec.h +0 -4
- package/libc/include/x86-linux-any/asm/kvm.h +13 -8
- package/libc/include/x86-linux-any/asm/svm.h +16 -16
- package/libc/include/x86-linux-any/asm/unistd_32.h +1 -0
- package/libc/include/x86-linux-any/asm/unistd_64.h +1 -0
- package/libc/include/x86-linux-any/asm/unistd_x32.h +1 -0
- package/libc/include/xtensa-linux-any/asm/unistd_32.h +1 -0
- package/libc/musl/arch/mipsn32/syscall_arch.h +35 -32
- package/package.json +1 -1
- package/std/Build/Cache.zig +6 -6
- package/std/Build/Step/Compile.zig +0 -1
- package/std/Build/Step/Run.zig +2 -2
- package/std/Build/Step.zig +2 -4
- package/std/Build/WebServer.zig +2 -2
- package/std/Build.zig +0 -3
- package/std/Io/Dir.zig +7 -2
- package/std/Io/Dispatch.zig +3 -13
- package/std/Io/File/Writer.zig +8 -6
- package/std/Io/Reader.zig +8 -9
- package/std/Io/Semaphore.zig +112 -17
- package/std/Io/Terminal.zig +1 -1
- package/std/Io/Threaded.zig +171 -37
- package/std/Io/Uring.zig +13 -15
- package/std/Io/Writer.zig +46 -42
- package/std/Io/net.zig +11 -11
- package/std/Io.zig +90 -26
- package/std/SemanticVersion.zig +1 -1
- package/std/Target/Query.zig +2 -2
- package/std/Target.zig +50 -5
- package/std/array_hash_map.zig +9 -18
- package/std/builtin.zig +4 -0
- package/std/c/haiku.zig +3 -0
- package/std/c/serenity.zig +1 -6
- package/std/c.zig +89 -7
- package/std/compress/flate/Decompress.zig +2 -3
- package/std/compress/zstd/Decompress.zig +2 -4
- package/std/crypto/Certificate.zig +13 -1
- package/std/crypto/ascon.zig +75 -33
- package/std/crypto/codecs/asn1/Oid.zig +12 -1
- package/std/crypto/codecs/base64_hex_ct.zig +2 -4
- package/std/crypto/ml_kem.zig +2 -9
- package/std/crypto/tls/Client.zig +79 -4
- package/std/crypto/tls.zig +1 -1
- package/std/crypto.zig +1 -0
- package/std/debug/Pdb.zig +1 -1
- package/std/debug.zig +4 -3
- package/std/fmt.zig +8 -3
- package/std/fs/path.zig +6 -4
- package/std/heap/BufferFirstAllocator.zig +165 -0
- package/std/heap.zig +2 -126
- package/std/http/Client.zig +21 -24
- package/std/http.zig +3 -4
- package/std/json/Scanner.zig +2 -2
- package/std/os/emscripten.zig +1 -1
- package/std/os/linux/IoUring.zig +2 -0
- package/std/os/linux/aarch64.zig +41 -12
- package/std/os/linux/arc.zig +173 -0
- package/std/os/linux/arm.zig +41 -12
- package/std/os/linux/hexagon.zig +33 -11
- package/std/os/linux/loongarch32.zig +41 -13
- package/std/os/linux/loongarch64.zig +41 -12
- package/std/os/linux/m68k.zig +41 -13
- package/std/os/linux/mips.zig +67 -36
- package/std/os/linux/mips64.zig +60 -29
- package/std/os/linux/mipsn32.zig +60 -29
- package/std/os/linux/or1k.zig +41 -12
- package/std/os/linux/powerpc.zig +41 -12
- package/std/os/linux/powerpc64.zig +41 -12
- package/std/os/linux/riscv32.zig +41 -12
- package/std/os/linux/riscv64.zig +41 -12
- package/std/os/linux/s390x.zig +44 -7
- package/std/os/linux/sparc64.zig +83 -52
- package/std/os/linux/syscalls.zig +26 -1
- package/std/os/linux/thumb.zig +52 -36
- package/std/os/linux/x32.zig +41 -12
- package/std/os/linux/x86.zig +42 -13
- package/std/os/linux/x86_64.zig +41 -12
- package/std/os/linux.zig +412 -436
- package/std/os/uefi/tables/boot_services.zig +9 -8
- package/std/os.zig +41 -0
- package/std/process.zig +1 -1
- package/std/sort.zig +3 -3
- package/std/zig/Ast/Render.zig +3 -3
- package/std/zig/AstGen.zig +44 -98
- package/std/zig/AstRlAnnotate.zig +0 -11
- package/std/zig/BuiltinFn.zig +0 -32
- package/std/zig/LibCInstallation.zig +4 -3
- package/std/zig/Parse.zig +7 -7
- package/std/zig/WindowsSdk.zig +13 -13
- package/std/zig/Zir.zig +50 -63
- package/std/zig/ZonGen.zig +6 -5
- package/std/zig/llvm/Builder.zig +12 -12
- package/std/zig.zig +1 -10
- package/std/zip.zig +5 -5
- package/zig.h +340 -1
- package/libc/include/hexagon-linux-any/asm/signal.h +0 -29
- package/libc/include/s390x-linux-any/asm/tape390.h +0 -103
- package/libc/mingw/math/fdiml.c +0 -24
- package/libc/mingw/winpthreads/spinlock.c +0 -82
- package/libc/musl/src/linux/tee.c +0 -8
- package/libc/musl/src/math/fdimf.c +0 -10
- package/libc/musl/src/math/fdiml.c +0 -18
- package/libc/musl/src/string/strdup.c +0 -10
- package/libc/musl/src/string/strndup.c +0 -12
- package/libc/musl/src/string/wcsdup.c +0 -10
- package/libc/musl/src/thread/pthread_spin_destroy.c +0 -6
- package/libc/musl/src/thread/pthread_spin_init.c +0 -6
- package/libc/musl/src/thread/pthread_spin_lock.c +0 -8
- package/libc/musl/src/thread/pthread_spin_trylock.c +0 -7
- package/libc/musl/src/thread/pthread_spin_unlock.c +0 -7
- package/libc/musl/src/unistd/dup2.c +0 -20
- package/libc/musl/src/unistd/dup3.c +0 -26
- package/libc/wasi/thread-stub/pthread_spin_lock.c +0 -8
- package/libc/wasi/thread-stub/pthread_spin_trylock.c +0 -8
- package/libc/wasi/thread-stub/pthread_spin_unlock.c +0 -7
package/std/zig/WindowsSdk.zig
CHANGED
|
@@ -47,7 +47,7 @@ pub fn find(
|
|
|
47
47
|
error.InstallationNotFound => null,
|
|
48
48
|
error.PathTooLong => null,
|
|
49
49
|
error.VersionTooLong => null,
|
|
50
|
-
error.OutOfMemory => return
|
|
50
|
+
error.OutOfMemory => |e| return e,
|
|
51
51
|
};
|
|
52
52
|
errdefer if (windows10sdk) |*w| w.free(gpa);
|
|
53
53
|
|
|
@@ -55,13 +55,13 @@ pub fn find(
|
|
|
55
55
|
error.InstallationNotFound => null,
|
|
56
56
|
error.PathTooLong => null,
|
|
57
57
|
error.VersionTooLong => null,
|
|
58
|
-
error.OutOfMemory => return
|
|
58
|
+
error.OutOfMemory => |e| return e,
|
|
59
59
|
};
|
|
60
60
|
errdefer if (windows81sdk) |*w| w.free(gpa);
|
|
61
61
|
|
|
62
62
|
const msvc_lib_dir: ?[]const u8 = MsvcLibDir.find(gpa, io, ®istry, arch, environ_map) catch |err| switch (err) {
|
|
63
63
|
error.MsvcLibDirNotFound => null,
|
|
64
|
-
error.OutOfMemory => return
|
|
64
|
+
error.OutOfMemory => |e| return e,
|
|
65
65
|
};
|
|
66
66
|
errdefer gpa.free(msvc_lib_dir);
|
|
67
67
|
|
|
@@ -498,7 +498,7 @@ pub const Installation = struct {
|
|
|
498
498
|
error.StringNotFound,
|
|
499
499
|
=> return error.InstallationNotFound,
|
|
500
500
|
|
|
501
|
-
error.OutOfMemory => return
|
|
501
|
+
error.OutOfMemory => |e| return e,
|
|
502
502
|
};
|
|
503
503
|
defer gpa.free(path_w_maybe_with_trailing_slash);
|
|
504
504
|
|
|
@@ -572,7 +572,7 @@ pub const Installation = struct {
|
|
|
572
572
|
error.StringNotFound,
|
|
573
573
|
=> return error.InstallationNotFound,
|
|
574
574
|
|
|
575
|
-
error.OutOfMemory => return
|
|
575
|
+
error.OutOfMemory => |e| return e,
|
|
576
576
|
};
|
|
577
577
|
defer gpa.free(path_w_maybe_with_trailing_slash);
|
|
578
578
|
|
|
@@ -593,7 +593,7 @@ pub const Installation = struct {
|
|
|
593
593
|
error.StringNotFound,
|
|
594
594
|
=> return error.InstallationNotFound,
|
|
595
595
|
|
|
596
|
-
error.OutOfMemory => return
|
|
596
|
+
error.OutOfMemory => |e| return e,
|
|
597
597
|
};
|
|
598
598
|
defer gpa.free(version_without_0);
|
|
599
599
|
|
|
@@ -664,7 +664,7 @@ const MsvcLibDir = struct {
|
|
|
664
664
|
error.StringNotFound,
|
|
665
665
|
=> return error.PathNotFound,
|
|
666
666
|
|
|
667
|
-
error.OutOfMemory => return
|
|
667
|
+
error.OutOfMemory => |e| return e,
|
|
668
668
|
};
|
|
669
669
|
defer gpa.free(packages_path);
|
|
670
670
|
|
|
@@ -708,7 +708,7 @@ const MsvcLibDir = struct {
|
|
|
708
708
|
error.StringNotFound,
|
|
709
709
|
=> return error.PathNotFound,
|
|
710
710
|
|
|
711
|
-
error.OutOfMemory => return
|
|
711
|
+
error.OutOfMemory => |e| return e,
|
|
712
712
|
};
|
|
713
713
|
defer gpa.free(dll_path);
|
|
714
714
|
|
|
@@ -1042,7 +1042,7 @@ const MsvcLibDir = struct {
|
|
|
1042
1042
|
const config_key = root_key.open(config_path) catch continue;
|
|
1043
1043
|
|
|
1044
1044
|
const source_directories_value = config_key.getString(gpa, .{ .name = L("Source Directories") }, .wtf8) catch |err| switch (err) {
|
|
1045
|
-
error.OutOfMemory => return
|
|
1045
|
+
error.OutOfMemory => |e| return e,
|
|
1046
1046
|
else => continue,
|
|
1047
1047
|
};
|
|
1048
1048
|
|
|
@@ -1118,7 +1118,7 @@ const MsvcLibDir = struct {
|
|
|
1118
1118
|
defer vs7_key.close();
|
|
1119
1119
|
try_vs7_key: {
|
|
1120
1120
|
const path_maybe_with_trailing_slash = vs7_key.getString(gpa, .{ .name = L("14.0") }, .wtf8) catch |err| switch (err) {
|
|
1121
|
-
error.OutOfMemory => return
|
|
1121
|
+
error.OutOfMemory => |e| return e,
|
|
1122
1122
|
else => break :try_vs7_key,
|
|
1123
1123
|
};
|
|
1124
1124
|
|
|
@@ -1178,11 +1178,11 @@ const MsvcLibDir = struct {
|
|
|
1178
1178
|
environ_map: *const Environ.Map,
|
|
1179
1179
|
) error{ OutOfMemory, MsvcLibDirNotFound }![]const u8 {
|
|
1180
1180
|
const full_path = MsvcLibDir.findViaCOM(gpa, io, registry, arch, environ_map) catch |err1| switch (err1) {
|
|
1181
|
-
error.OutOfMemory => return
|
|
1181
|
+
error.OutOfMemory => |e| return e,
|
|
1182
1182
|
error.PathNotFound => MsvcLibDir.findViaRegistry(gpa, io, arch, environ_map) catch |err2| switch (err2) {
|
|
1183
|
-
error.OutOfMemory => return
|
|
1183
|
+
error.OutOfMemory => |e| return e,
|
|
1184
1184
|
error.PathNotFound => MsvcLibDir.findViaVs7Key(gpa, io, registry, arch, environ_map) catch |err3| switch (err3) {
|
|
1185
|
-
error.OutOfMemory => return
|
|
1185
|
+
error.OutOfMemory => |e| return e,
|
|
1186
1186
|
error.PathNotFound => return error.MsvcLibDirNotFound,
|
|
1187
1187
|
},
|
|
1188
1188
|
},
|
package/std/zig/Zir.zig
CHANGED
|
@@ -1016,9 +1016,6 @@ pub const Inst = struct {
|
|
|
1016
1016
|
/// Implements the `@max` builtin for 2 args.
|
|
1017
1017
|
/// Uses the `pl_node` union field with payload `Bin`
|
|
1018
1018
|
max,
|
|
1019
|
-
/// Implements the `@cImport` builtin.
|
|
1020
|
-
/// Uses the `pl_node` union field with payload `Block`.
|
|
1021
|
-
c_import,
|
|
1022
1019
|
|
|
1023
1020
|
/// Allocates stack local memory.
|
|
1024
1021
|
/// Uses the `un_node` union field. The operand is the type of the allocated object.
|
|
@@ -1297,7 +1294,6 @@ pub const Inst = struct {
|
|
|
1297
1294
|
.memset,
|
|
1298
1295
|
.memmove,
|
|
1299
1296
|
.min,
|
|
1300
|
-
.c_import,
|
|
1301
1297
|
.@"resume",
|
|
1302
1298
|
.ret_err_value_code,
|
|
1303
1299
|
.extended,
|
|
@@ -1577,7 +1573,6 @@ pub const Inst = struct {
|
|
|
1577
1573
|
.builtin_call,
|
|
1578
1574
|
.max,
|
|
1579
1575
|
.min,
|
|
1580
|
-
.c_import,
|
|
1581
1576
|
.@"resume",
|
|
1582
1577
|
.ret_err_value_code,
|
|
1583
1578
|
.@"break",
|
|
@@ -1857,7 +1852,6 @@ pub const Inst = struct {
|
|
|
1857
1852
|
.memset = .pl_node,
|
|
1858
1853
|
.memmove = .pl_node,
|
|
1859
1854
|
.min = .pl_node,
|
|
1860
|
-
.c_import = .pl_node,
|
|
1861
1855
|
|
|
1862
1856
|
.alloc = .un_node,
|
|
1863
1857
|
.alloc_mut = .un_node,
|
|
@@ -2018,12 +2012,6 @@ pub const Inst = struct {
|
|
|
2018
2012
|
/// `small` is unused.
|
|
2019
2013
|
round_op_ty,
|
|
2020
2014
|
/// `operand` is payload index to `UnNode`.
|
|
2021
|
-
c_undef,
|
|
2022
|
-
/// `operand` is payload index to `UnNode`.
|
|
2023
|
-
c_include,
|
|
2024
|
-
/// `operand` is payload index to `BinNode`.
|
|
2025
|
-
c_define,
|
|
2026
|
-
/// `operand` is payload index to `UnNode`.
|
|
2027
2015
|
wasm_memory_size,
|
|
2028
2016
|
/// `operand` is payload index to `BinNode`.
|
|
2029
2017
|
wasm_memory_grow,
|
|
@@ -4033,30 +4021,30 @@ pub const DeclContents = struct {
|
|
|
4033
4021
|
/// This is a simple optional because ZIR guarantees that a `func`/`func_inferred`/`func_fancy` instruction
|
|
4034
4022
|
/// can only occur once per `declaration`.
|
|
4035
4023
|
func_decl: ?Inst.Index,
|
|
4036
|
-
|
|
4024
|
+
type_decls: std.ArrayList(Inst.Index),
|
|
4037
4025
|
other: std.ArrayList(Inst.Index),
|
|
4038
4026
|
|
|
4039
4027
|
pub const init: DeclContents = .{
|
|
4040
4028
|
.func_decl = null,
|
|
4041
|
-
.
|
|
4029
|
+
.type_decls = .empty,
|
|
4042
4030
|
.other = .empty,
|
|
4043
4031
|
};
|
|
4044
4032
|
|
|
4045
4033
|
pub fn clear(contents: *DeclContents) void {
|
|
4046
4034
|
contents.func_decl = null;
|
|
4047
|
-
contents.
|
|
4035
|
+
contents.type_decls.clearRetainingCapacity();
|
|
4048
4036
|
contents.other.clearRetainingCapacity();
|
|
4049
4037
|
}
|
|
4050
4038
|
|
|
4051
4039
|
pub fn deinit(contents: *DeclContents, gpa: Allocator) void {
|
|
4052
|
-
contents.
|
|
4040
|
+
contents.type_decls.deinit(gpa);
|
|
4053
4041
|
contents.other.deinit(gpa);
|
|
4054
4042
|
}
|
|
4055
4043
|
};
|
|
4056
4044
|
|
|
4057
4045
|
/// Find all tracked ZIR instructions, recursively, within a `declaration` instruction. Does not recurse through
|
|
4058
4046
|
/// nested declarations; to find all declarations, call this function recursively on the type declarations discovered
|
|
4059
|
-
/// in `contents.
|
|
4047
|
+
/// in `contents.type_decls`.
|
|
4060
4048
|
///
|
|
4061
4049
|
/// This populates an `ArrayList` because an iterator would need to allocate memory anyway.
|
|
4062
4050
|
pub fn findTrackable(zir: Zir, gpa: Allocator, contents: *DeclContents, decl_inst: Zir.Inst.Index) !void {
|
|
@@ -4076,15 +4064,49 @@ pub fn findTrackable(zir: Zir, gpa: Allocator, contents: *DeclContents, decl_ins
|
|
|
4076
4064
|
if (decl.value_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4077
4065
|
}
|
|
4078
4066
|
|
|
4079
|
-
///
|
|
4080
|
-
///
|
|
4081
|
-
pub fn
|
|
4067
|
+
/// `findTrackable` does not recurse into field expressions in a type. Instead, this function will
|
|
4068
|
+
/// scan specifically field expressions in a given type declaration for trackable ZIR instructions.
|
|
4069
|
+
pub fn findTrackableFields(
|
|
4070
|
+
zir: *const Zir,
|
|
4071
|
+
gpa: Allocator,
|
|
4072
|
+
contents: *DeclContents,
|
|
4073
|
+
type_decl_inst: Zir.Inst.Index,
|
|
4074
|
+
) Allocator.Error!void {
|
|
4082
4075
|
contents.clear();
|
|
4083
4076
|
|
|
4084
4077
|
var found_defers: std.AutoHashMapUnmanaged(u32, void) = .empty;
|
|
4085
4078
|
defer found_defers.deinit(gpa);
|
|
4086
4079
|
|
|
4087
|
-
|
|
4080
|
+
assert(zir.instructions.items(.tag)[@intFromEnum(type_decl_inst)] == .extended);
|
|
4081
|
+
switch (zir.instructions.items(.data)[@intFromEnum(type_decl_inst)].extended.opcode) {
|
|
4082
|
+
.struct_decl => {
|
|
4083
|
+
const struct_decl = zir.getStructDecl(type_decl_inst);
|
|
4084
|
+
var it = struct_decl.iterateFields();
|
|
4085
|
+
while (it.next()) |field| {
|
|
4086
|
+
try zir.findTrackableBody(gpa, contents, &found_defers, field.type_body);
|
|
4087
|
+
if (field.align_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4088
|
+
if (field.default_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4089
|
+
}
|
|
4090
|
+
},
|
|
4091
|
+
.union_decl => {
|
|
4092
|
+
const union_decl = zir.getUnionDecl(type_decl_inst);
|
|
4093
|
+
var it = union_decl.iterateFields();
|
|
4094
|
+
while (it.next()) |field| {
|
|
4095
|
+
if (field.type_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4096
|
+
if (field.align_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4097
|
+
if (field.value_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4098
|
+
}
|
|
4099
|
+
},
|
|
4100
|
+
.enum_decl => {
|
|
4101
|
+
const enum_decl = zir.getEnumDecl(type_decl_inst);
|
|
4102
|
+
var it = enum_decl.iterateFields();
|
|
4103
|
+
while (it.next()) |field| {
|
|
4104
|
+
if (field.value_body) |b| try zir.findTrackableBody(gpa, contents, &found_defers, b);
|
|
4105
|
+
}
|
|
4106
|
+
},
|
|
4107
|
+
.opaque_decl => {},
|
|
4108
|
+
else => unreachable,
|
|
4109
|
+
}
|
|
4088
4110
|
}
|
|
4089
4111
|
|
|
4090
4112
|
fn findTrackableInner(
|
|
@@ -4360,9 +4382,6 @@ fn findTrackableInner(
|
|
|
4360
4382
|
.mul_with_overflow,
|
|
4361
4383
|
.shl_with_overflow,
|
|
4362
4384
|
.round_op,
|
|
4363
|
-
.c_undef,
|
|
4364
|
-
.c_include,
|
|
4365
|
-
.c_define,
|
|
4366
4385
|
.wasm_memory_size,
|
|
4367
4386
|
.wasm_memory_grow,
|
|
4368
4387
|
.prefetch,
|
|
@@ -4411,49 +4430,18 @@ fn findTrackableInner(
|
|
|
4411
4430
|
try zir.findTrackableBody(gpa, contents, defers, body);
|
|
4412
4431
|
},
|
|
4413
4432
|
|
|
4414
|
-
// Reifications
|
|
4433
|
+
// Reifications need tracking.
|
|
4415
4434
|
.reify_enum,
|
|
4416
4435
|
.reify_struct,
|
|
4417
4436
|
.reify_union,
|
|
4418
|
-
.opaque_decl,
|
|
4419
4437
|
=> return contents.other.append(gpa, inst),
|
|
4420
4438
|
|
|
4421
|
-
//
|
|
4422
|
-
.struct_decl
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
while (it.next()) |field| {
|
|
4428
|
-
try zir.findTrackableBody(gpa, contents, defers, field.type_body);
|
|
4429
|
-
if (field.align_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4430
|
-
if (field.default_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4431
|
-
}
|
|
4432
|
-
},
|
|
4433
|
-
|
|
4434
|
-
// Union declarations need tracking and have bodies.
|
|
4435
|
-
.union_decl => {
|
|
4436
|
-
try contents.explicit_types.append(gpa, inst);
|
|
4437
|
-
|
|
4438
|
-
const union_decl = zir.getUnionDecl(inst);
|
|
4439
|
-
var it = union_decl.iterateFields();
|
|
4440
|
-
while (it.next()) |field| {
|
|
4441
|
-
if (field.type_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4442
|
-
if (field.align_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4443
|
-
if (field.value_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4444
|
-
}
|
|
4445
|
-
},
|
|
4446
|
-
|
|
4447
|
-
// Enum declarations need tracking and have bodies.
|
|
4448
|
-
.enum_decl => {
|
|
4449
|
-
try contents.explicit_types.append(gpa, inst);
|
|
4450
|
-
|
|
4451
|
-
const enum_decl = zir.getEnumDecl(inst);
|
|
4452
|
-
var it = enum_decl.iterateFields();
|
|
4453
|
-
while (it.next()) |field| {
|
|
4454
|
-
if (field.value_body) |b| try zir.findTrackableBody(gpa, contents, defers, b);
|
|
4455
|
-
}
|
|
4456
|
-
},
|
|
4439
|
+
// Type declarations need tracking.
|
|
4440
|
+
.struct_decl,
|
|
4441
|
+
.union_decl,
|
|
4442
|
+
.enum_decl,
|
|
4443
|
+
.opaque_decl,
|
|
4444
|
+
=> return contents.type_decls.append(gpa, inst),
|
|
4457
4445
|
}
|
|
4458
4446
|
},
|
|
4459
4447
|
|
|
@@ -4532,7 +4520,6 @@ fn findTrackableInner(
|
|
|
4532
4520
|
|
|
4533
4521
|
.block,
|
|
4534
4522
|
.block_inline,
|
|
4535
|
-
.c_import,
|
|
4536
4523
|
.typeof_builtin,
|
|
4537
4524
|
.loop,
|
|
4538
4525
|
=> {
|
package/std/zig/ZonGen.zig
CHANGED
|
@@ -427,10 +427,11 @@ fn expr(zg: *ZonGen, node: Ast.Node.Index, dest_node: Zoir.Node.Index) Allocator
|
|
|
427
427
|
});
|
|
428
428
|
|
|
429
429
|
// For short initializers, track the names on the stack rather than going through gpa.
|
|
430
|
-
var
|
|
431
|
-
|
|
430
|
+
var bfa_buf: [256]u8 = undefined;
|
|
431
|
+
var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, gpa);
|
|
432
|
+
const bfa = bfa_state.allocator();
|
|
432
433
|
var field_names: std.AutoHashMapUnmanaged(Zoir.NullTerminatedString, Ast.TokenIndex) = .empty;
|
|
433
|
-
defer field_names.deinit(
|
|
434
|
+
defer field_names.deinit(bfa);
|
|
434
435
|
|
|
435
436
|
var reported_any_duplicate = false;
|
|
436
437
|
|
|
@@ -438,7 +439,7 @@ fn expr(zg: *ZonGen, node: Ast.Node.Index, dest_node: Zoir.Node.Index) Allocator
|
|
|
438
439
|
const name_token = tree.firstToken(elem_node) - 2;
|
|
439
440
|
if (zg.identAsString(name_token)) |name_str| {
|
|
440
441
|
zg.extra.items[extra_name_idx] = @intFromEnum(name_str);
|
|
441
|
-
const gop = try field_names.getOrPut(
|
|
442
|
+
const gop = try field_names.getOrPut(bfa, name_str);
|
|
442
443
|
if (gop.found_existing and !reported_any_duplicate) {
|
|
443
444
|
reported_any_duplicate = true;
|
|
444
445
|
const earlier_token = gop.value_ptr.*;
|
|
@@ -667,7 +668,7 @@ fn numberLiteral(zg: *ZonGen, num_node: Ast.Node.Index, src_node: Ast.Node.Index
|
|
|
667
668
|
big_int.setString(@intFromEnum(base), num_without_prefix) catch |err| switch (err) {
|
|
668
669
|
error.InvalidCharacter => unreachable, // caught in `parseNumberLiteral`
|
|
669
670
|
error.InvalidBase => unreachable, // we only pass 16, 8, 2, see above
|
|
670
|
-
error.OutOfMemory => return
|
|
671
|
+
error.OutOfMemory => |e| return e,
|
|
671
672
|
};
|
|
672
673
|
switch (sign) {
|
|
673
674
|
.positive => {},
|
package/std/zig/llvm/Builder.zig
CHANGED
|
@@ -7638,9 +7638,9 @@ pub const Constant = enum(u32) {
|
|
|
7638
7638
|
std.math.big.int.calcToStringLimbsBufferLen(expected_limbs, 10)
|
|
7639
7639
|
]std.math.big.Limb,
|
|
7640
7640
|
};
|
|
7641
|
-
var
|
|
7642
|
-
|
|
7643
|
-
const allocator =
|
|
7641
|
+
var bfa_buf: ExpectedContents = undefined;
|
|
7642
|
+
var bfa: std.heap.BufferFirstAllocator = .init(@ptrCast(&bfa_buf), data.builder.gpa);
|
|
7643
|
+
const allocator = bfa.allocator();
|
|
7644
7644
|
const str = bigint.toStringAlloc(allocator, 10, undefined) catch return error.WriteFailed;
|
|
7645
7645
|
defer allocator.free(str);
|
|
7646
7646
|
try w.writeAll(str);
|
|
@@ -9209,9 +9209,9 @@ pub fn getIntrinsic(
|
|
|
9209
9209
|
fields: [expected_fields_len]Type,
|
|
9210
9210
|
},
|
|
9211
9211
|
};
|
|
9212
|
-
var
|
|
9213
|
-
|
|
9214
|
-
const allocator =
|
|
9212
|
+
var bfa_buf: ExpectedContents = undefined;
|
|
9213
|
+
var bfa: std.heap.BufferFirstAllocator = .init(@ptrCast(&bfa_buf), self.gpa);
|
|
9214
|
+
const allocator = bfa.allocator();
|
|
9215
9215
|
|
|
9216
9216
|
const name = name: {
|
|
9217
9217
|
{
|
|
@@ -10607,9 +10607,9 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
|
|
|
10607
10607
|
std.math.big.int.calcToStringLimbsBufferLen(expected_limbs, 10)
|
|
10608
10608
|
]std.math.big.Limb,
|
|
10609
10609
|
};
|
|
10610
|
-
var
|
|
10611
|
-
|
|
10612
|
-
const allocator =
|
|
10610
|
+
var bfa_buf: ExpectedContents = undefined;
|
|
10611
|
+
var bfa: std.heap.BufferFirstAllocator = .init(@ptrCast(&bfa_buf), self.gpa);
|
|
10612
|
+
const allocator = bfa.allocator();
|
|
10613
10613
|
|
|
10614
10614
|
const limbs = self.metadata_limbs.items[extra.limbs_index..][0..extra.limbs_len];
|
|
10615
10615
|
const bigint: std.math.big.int.Const = .{
|
|
@@ -11129,9 +11129,9 @@ fn bigIntConstAssumeCapacity(
|
|
|
11129
11129
|
const bits = type_item.data;
|
|
11130
11130
|
|
|
11131
11131
|
const ExpectedContents = [64 / @sizeOf(std.math.big.Limb)]std.math.big.Limb;
|
|
11132
|
-
var
|
|
11133
|
-
|
|
11134
|
-
const allocator =
|
|
11132
|
+
var bfa_buf: ExpectedContents = undefined;
|
|
11133
|
+
var bfa: std.heap.BufferFirstAllocator = .init(@ptrCast(&bfa_buf), self.gpa);
|
|
11134
|
+
const allocator = bfa.allocator();
|
|
11135
11135
|
|
|
11136
11136
|
var limbs: []std.math.big.Limb = &.{};
|
|
11137
11137
|
defer allocator.free(limbs);
|
package/std/zig.zig
CHANGED
|
@@ -744,6 +744,7 @@ pub fn parseTargetQueryOrReportFatalError(
|
|
|
744
744
|
pub const EnvVar = enum {
|
|
745
745
|
ZIG_GLOBAL_CACHE_DIR,
|
|
746
746
|
ZIG_LOCAL_CACHE_DIR,
|
|
747
|
+
ZIG_LOCAL_PKG_DIR,
|
|
747
748
|
ZIG_LIB_DIR,
|
|
748
749
|
ZIG_LIBC,
|
|
749
750
|
ZIG_BUILD_RUNNER,
|
|
@@ -796,11 +797,6 @@ pub const SimpleComptimeReason = enum(u32) {
|
|
|
796
797
|
operand_branchHint,
|
|
797
798
|
operand_setRuntimeSafety,
|
|
798
799
|
operand_embedFile,
|
|
799
|
-
operand_cImport,
|
|
800
|
-
operand_cDefine_macro_name,
|
|
801
|
-
operand_cDefine_macro_value,
|
|
802
|
-
operand_cInclude_file_name,
|
|
803
|
-
operand_cUndef_macro_name,
|
|
804
800
|
operand_shuffle_mask,
|
|
805
801
|
operand_atomicRmw_operation,
|
|
806
802
|
operand_reduce_operation,
|
|
@@ -891,11 +887,6 @@ pub const SimpleComptimeReason = enum(u32) {
|
|
|
891
887
|
.operand_branchHint => "operand to '@branchHint' must be comptime-known",
|
|
892
888
|
.operand_setRuntimeSafety => "operand to '@setRuntimeSafety' must be comptime-known",
|
|
893
889
|
.operand_embedFile => "operand to '@embedFile' must be comptime-known",
|
|
894
|
-
.operand_cImport => "operand to '@cImport' is evaluated at comptime",
|
|
895
|
-
.operand_cDefine_macro_name => "'@cDefine' macro name must be comptime-known",
|
|
896
|
-
.operand_cDefine_macro_value => "'@cDefine' macro value must be comptime-known",
|
|
897
|
-
.operand_cInclude_file_name => "'@cInclude' file name must be comptime-known",
|
|
898
|
-
.operand_cUndef_macro_name => "'@cUndef' macro name must be comptime-known",
|
|
899
890
|
.operand_shuffle_mask => "'@shuffle' mask must be comptime-known",
|
|
900
891
|
.operand_atomicRmw_operation => "'@atomicRmw' operation must be comptime-known",
|
|
901
892
|
.operand_reduce_operation => "'@reduce' operation must be comptime-known",
|
package/std/zip.zig
CHANGED
|
@@ -143,7 +143,7 @@ pub const EndRecord = extern struct {
|
|
|
143
143
|
const read_buf: []u8 = buf[buf.len - new_loaded_len ..][0..read_len];
|
|
144
144
|
fr.interface.readSliceAll(read_buf) catch |err| switch (err) {
|
|
145
145
|
error.ReadFailed => return fr.err.?,
|
|
146
|
-
error.EndOfStream => return
|
|
146
|
+
error.EndOfStream => |e| return e,
|
|
147
147
|
};
|
|
148
148
|
loaded_len = new_loaded_len;
|
|
149
149
|
}
|
|
@@ -310,7 +310,7 @@ pub const Iterator = struct {
|
|
|
310
310
|
try input.seekTo(stream_len - locator_end_offset);
|
|
311
311
|
const locator = input.interface.takeStruct(EndLocator64, .little) catch |err| switch (err) {
|
|
312
312
|
error.ReadFailed => return input.err.?,
|
|
313
|
-
error.EndOfStream => return
|
|
313
|
+
error.EndOfStream => |e| return e,
|
|
314
314
|
};
|
|
315
315
|
if (!std.mem.eql(u8, &locator.signature, &end_locator64_sig))
|
|
316
316
|
return error.ZipBadLocatorSig;
|
|
@@ -323,7 +323,7 @@ pub const Iterator = struct {
|
|
|
323
323
|
|
|
324
324
|
const record64 = input.interface.takeStruct(EndRecord64, .little) catch |err| switch (err) {
|
|
325
325
|
error.ReadFailed => return input.err.?,
|
|
326
|
-
error.EndOfStream => return
|
|
326
|
+
error.EndOfStream => |e| return e,
|
|
327
327
|
};
|
|
328
328
|
|
|
329
329
|
if (!std.mem.eql(u8, &record64.signature, &end_record64_sig))
|
|
@@ -379,7 +379,7 @@ pub const Iterator = struct {
|
|
|
379
379
|
try input.seekTo(header_zip_offset);
|
|
380
380
|
const header = input.interface.takeStruct(CentralDirectoryFileHeader, .little) catch |err| switch (err) {
|
|
381
381
|
error.ReadFailed => return input.err.?,
|
|
382
|
-
error.EndOfStream => return
|
|
382
|
+
error.EndOfStream => |e| return e,
|
|
383
383
|
};
|
|
384
384
|
if (!std.mem.eql(u8, &header.signature, ¢ral_file_header_sig))
|
|
385
385
|
return error.ZipBadCdOffset;
|
|
@@ -410,7 +410,7 @@ pub const Iterator = struct {
|
|
|
410
410
|
try input.seekTo(header_zip_offset + @sizeOf(CentralDirectoryFileHeader) + header.filename_len);
|
|
411
411
|
input.interface.readSliceAll(extra) catch |err| switch (err) {
|
|
412
412
|
error.ReadFailed => return input.err.?,
|
|
413
|
-
error.EndOfStream => return
|
|
413
|
+
error.EndOfStream => |e| return e,
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
var extra_offset: usize = 0;
|