commit 1deb029a665399838ca0bfbc451af02bc091200f (tree)
parent c166c49b1917bb682d6949150feb59e54d6c0b2d
Author: GasInfinity <me@gasinfinity.dev>
Date: Thu, 23 Apr 2026 14:03:08 +0200
std: rename `bit_set` variants and deprecate the managed one.
* aliases and deprecates the previous names.
* also update callsites to use the non-deprecated declarations.
Diffstat:
19 files changed, 105 insertions(+), 85 deletions(-)
diff --git a/lib/compiler/resinator/compile.zig b/lib/compiler/resinator/compile.zig
@@ -3084,7 +3084,7 @@ pub const StringTable = struct {
pub const Block = struct {
strings: std.ArrayList(Token) = .empty,
- set_indexes: std.bit_set.IntegerBitSet(16) = .{ .mask = 0 },
+ set_indexes: std.bit_set.Integer(16) = .{ .mask = 0 },
memory_flags: MemoryFlags = MemoryFlags.defaults(res.RT.STRING),
characteristics: u32,
version: u32,
diff --git a/lib/std/Build/Step/ConfigHeader.zig b/lib/std/Build/Step/ConfigHeader.zig
@@ -290,7 +290,7 @@ fn render_autoconf_undef(
const build = step.owner;
const allocator = build.allocator;
- var is_used: std.DynamicBitSetUnmanaged = try .initEmpty(allocator, values.count());
+ var is_used: std.bit_set.Dynamic = try .initEmpty(allocator, values.count());
defer is_used.deinit(allocator);
var any_errors = false;
diff --git a/lib/std/Io/Kqueue.zig b/lib/std/Io/Kqueue.zig
@@ -79,7 +79,7 @@ const Fiber = struct {
awaiter: ?*Fiber,
queue_next: ?*Fiber,
cancel_thread: ?*Thread,
- awaiting_completions: std.StaticBitSet(3),
+ awaiting_completions: std.bit_set.Static(3),
const finished: ?*Fiber = @ptrFromInt(@alignOf(Thread));
diff --git a/lib/std/bit_set.zig b/lib/std/bit_set.zig
@@ -8,50 +8,55 @@
//!
//! There are five variants defined here:
//!
-//! IntegerBitSet:
+//! Integer:
//! A bit set with static size, which is backed by a single integer.
//! This set is good for sets with a small size, but may generate
//! inefficient code for larger sets, especially in debug mode.
//!
-//! ArrayBitSet:
+//! Array:
//! A bit set with static size, which is backed by an array of usize.
//! This set is good for sets with a larger size, but may use
//! more bytes than necessary if your set is small.
//!
-//! StaticBitSet:
-//! Picks either IntegerBitSet or ArrayBitSet depending on the requested
+//! Static:
+//! Picks either Integer or Array depending on the requested
//! size. The interfaces of these two types match exactly, except for fields.
//!
-//! DynamicBitSet:
+//! Dynamic:
//! A bit set with runtime-known size, backed by an allocated slice
//! of usize.
//!
-//! DynamicBitSetUnmanaged:
-//! A variant of DynamicBitSet which does not store a pointer to its
-//! allocator, in order to save space.
+//! DynamicManaged:
+//! A variant of Dynamic which stores an allocator, using it when needed.
const std = @import("std.zig");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const builtin = @import("builtin");
+/// Deprecated: use `Static`.
+pub const StaticBitSet = Static;
+
/// Returns the optimal static bit set type for the specified number
/// of elements: either `IntegerBitSet` or `ArrayBitSet`,
/// both of which fulfill the same interface.
/// The returned type will perform no allocations,
/// can be copied by value, and does not require deinitialization.
-pub fn StaticBitSet(comptime size: usize) type {
+pub fn Static(comptime size: usize) type {
if (size <= @bitSizeOf(usize)) {
- return IntegerBitSet(size);
+ return Integer(size);
} else {
- return ArrayBitSet(usize, size);
+ return Array(usize, size);
}
}
+/// Deprecated: use `Integer`.
+pub const IntegerBitSet = Integer;
+
/// A bit set with static size, which is backed by a single integer.
/// This set is good for sets with a small size, but may generate
/// inefficient code for larger sets, especially in debug mode.
-pub fn IntegerBitSet(comptime size: u16) type {
+pub fn Integer(comptime size: u16) type {
return packed struct(MaskInt) {
const Self = @This();
@@ -328,21 +333,24 @@ pub fn IntegerBitSet(comptime size: u16) type {
};
}
+/// Deprecated: use `Array`.
+pub const ArrayBitSet = Array;
+
/// A bit set with static size, which is backed by an array of usize.
/// This set is good for sets with a larger size, but may use
/// more bytes than necessary if your set is small.
-pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
+pub fn Array(comptime MaskIntType: type, comptime size: usize) type {
const mask_info: std.builtin.Type = @typeInfo(MaskIntType);
// Make sure the mask int is indeed an int
- if (mask_info != .int) @compileError("ArrayBitSet can only operate on integer masks, but was passed " ++ @typeName(MaskIntType));
+ if (mask_info != .int) @compileError("Array can only operate on integer masks, but was passed " ++ @typeName(MaskIntType));
// It must also be unsigned.
- if (mask_info.int.signedness != .unsigned) @compileError("ArrayBitSet requires an unsigned integer mask type, but was passed " ++ @typeName(MaskIntType));
+ if (mask_info.int.signedness != .unsigned) @compileError("Array requires an unsigned integer mask type, but was passed " ++ @typeName(MaskIntType));
// And it must not be empty.
if (MaskIntType == u0)
- @compileError("ArrayBitSet requires a sized integer for its mask int. u0 does not work.");
+ @compileError("Array requires a sized integer for its mask int. u0 does not work.");
const byte_size = std.mem.byte_size_in_bits;
@@ -352,7 +360,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
var desired_bits = std.math.ceilPowerOfTwoAssert(usize, @bitSizeOf(MaskIntType));
if (desired_bits < byte_size) desired_bits = byte_size;
const FixedMaskType = std.meta.Int(.unsigned, desired_bits);
- @compileError("ArrayBitSet was passed integer type " ++ @typeName(MaskIntType) ++
+ @compileError("Array was passed integer type " ++ @typeName(MaskIntType) ++
", which is not a power of two. Please round this up to a power of two integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
}
@@ -363,7 +371,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
var desired_bits = @sizeOf(MaskIntType) * byte_size;
desired_bits = std.math.ceilPowerOfTwoAssert(usize, desired_bits);
const FixedMaskType = std.meta.Int(.unsigned, desired_bits);
- @compileError("ArrayBitSet was passed integer type " ++ @typeName(MaskIntType) ++
+ @compileError("Array was passed integer type " ++ @typeName(MaskIntType) ++
", which contains padding bits. Please round this up to an unpadded integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
}
@@ -673,7 +681,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
}
pub fn Iterator(comptime options: IteratorOptions) type {
- return BitSetIterator(MaskInt, options);
+ return GenericIterator(MaskInt, options);
}
fn maskBit(index: usize) MaskInt {
@@ -688,9 +696,12 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
};
}
+/// Deprecated: use `Dynamic`.
+pub const DynamicBitSetUnmanaged = Dynamic;
+
/// A bit set with runtime-known size, backed by an allocated slice
/// of usize. The allocator must be tracked externally by the user.
-pub const DynamicBitSetUnmanaged = struct {
+pub const Dynamic = struct {
const Self = @This();
/// The integer type used to represent a mask in this bit set
@@ -1074,7 +1085,7 @@ pub const DynamicBitSetUnmanaged = struct {
}
pub fn Iterator(comptime options: IteratorOptions) type {
- return BitSetIterator(MaskInt, options);
+ return GenericIterator(MaskInt, options);
}
fn maskBit(index: usize) MaskInt {
@@ -1091,10 +1102,16 @@ pub const DynamicBitSetUnmanaged = struct {
}
};
+/// Deprecated: use `DynamicManaged` or `Dynamic` (will need to update callsites).
+pub const DynamicBitSet = DynamicManaged;
+
/// A bit set with runtime-known size, backed by an allocated slice
-/// of usize. Thin wrapper around DynamicBitSetUnmanaged which keeps
+/// of usize. Thin wrapper around Dynamic which keeps
/// track of the allocator instance.
-pub const DynamicBitSet = struct {
+///
+/// Deprecated in favor of `Dynamic` which accepts an `Allocator`
+/// as a parameter when needed instead of storing it.
+pub const DynamicManaged = struct {
const Self = @This();
/// The integer type used to represent a mask in this bit set
@@ -1104,12 +1121,12 @@ pub const DynamicBitSet = struct {
pub const ShiftInt = std.math.Log2Int(MaskInt);
allocator: Allocator,
- unmanaged: DynamicBitSetUnmanaged = .{},
+ unmanaged: Dynamic = .{},
/// Creates a bit set with no elements present.
pub fn initEmpty(allocator: Allocator, bit_length: usize) !Self {
return Self{
- .unmanaged = try DynamicBitSetUnmanaged.initEmpty(allocator, bit_length),
+ .unmanaged = try .initEmpty(allocator, bit_length),
.allocator = allocator,
};
}
@@ -1117,7 +1134,7 @@ pub const DynamicBitSet = struct {
/// Creates a bit set with all elements present.
pub fn initFull(allocator: Allocator, bit_length: usize) !Self {
return Self{
- .unmanaged = try DynamicBitSetUnmanaged.initFull(allocator, bit_length),
+ .unmanaged = try .initFull(allocator, bit_length),
.allocator = allocator,
};
}
@@ -1247,7 +1264,7 @@ pub const DynamicBitSet = struct {
return self.unmanaged.iterator(options);
}
- pub const Iterator = DynamicBitSetUnmanaged.Iterator;
+ pub const Iterator = Dynamic.Iterator;
};
/// Options for configuring an iterator over a bit set
@@ -1274,7 +1291,7 @@ pub const IteratorOptions = struct {
};
// The iterator is reusable between several bit set types
-fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) type {
+fn GenericIterator(comptime MaskInt: type, comptime options: IteratorOptions) type {
const ShiftInt = std.math.Log2Int(MaskInt);
const kind = options.kind;
const direction = options.direction;
@@ -1713,37 +1730,37 @@ fn testStaticBitSet(comptime Set: type) !void {
try testPureBitSet(Set);
}
-test IntegerBitSet {
+test Integer {
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
if (comptime builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24300
- try testStaticBitSet(IntegerBitSet(0));
- try testStaticBitSet(IntegerBitSet(1));
- try testStaticBitSet(IntegerBitSet(2));
- try testStaticBitSet(IntegerBitSet(5));
- try testStaticBitSet(IntegerBitSet(8));
- try testStaticBitSet(IntegerBitSet(32));
- try testStaticBitSet(IntegerBitSet(64));
- try testStaticBitSet(IntegerBitSet(127));
+ try testStaticBitSet(Integer(0));
+ try testStaticBitSet(Integer(1));
+ try testStaticBitSet(Integer(2));
+ try testStaticBitSet(Integer(5));
+ try testStaticBitSet(Integer(8));
+ try testStaticBitSet(Integer(32));
+ try testStaticBitSet(Integer(64));
+ try testStaticBitSet(Integer(127));
}
-test ArrayBitSet {
+test Array {
inline for (.{ 0, 1, 2, 31, 32, 33, 63, 64, 65, 254, 500, 3000 }) |size| {
- try testStaticBitSet(ArrayBitSet(u8, size));
- try testStaticBitSet(ArrayBitSet(u16, size));
- try testStaticBitSet(ArrayBitSet(u32, size));
- try testStaticBitSet(ArrayBitSet(u64, size));
- try testStaticBitSet(ArrayBitSet(u128, size));
+ try testStaticBitSet(Array(u8, size));
+ try testStaticBitSet(Array(u16, size));
+ try testStaticBitSet(Array(u32, size));
+ try testStaticBitSet(Array(u64, size));
+ try testStaticBitSet(Array(u128, size));
}
}
-test DynamicBitSetUnmanaged {
+test Dynamic {
const allocator = std.testing.allocator;
- var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);
+ var a: Dynamic = try .initEmpty(allocator, 300);
try testing.expectEqual(@as(usize, 0), a.count());
a.deinit(allocator);
- a = try DynamicBitSetUnmanaged.initEmpty(allocator, 0);
+ a = try .initEmpty(allocator, 0);
defer a.deinit(allocator);
for ([_]usize{ 1, 2, 31, 32, 33, 0, 65, 64, 63, 500, 254, 3000 }) |size| {
const old_len = a.capacity();
@@ -1769,17 +1786,17 @@ test DynamicBitSetUnmanaged {
}
try testing.expectEqual(@as(usize, 0), empty.count());
- var full = try DynamicBitSetUnmanaged.initFull(allocator, size);
+ var full: Dynamic = try .initFull(allocator, size);
defer full.deinit(allocator);
try testing.expectEqual(@as(usize, size), full.count());
try testEql(empty, full, size);
{
- var even = try DynamicBitSetUnmanaged.initEmpty(allocator, size);
+ var even: Dynamic = try .initEmpty(allocator, size);
defer even.deinit(allocator);
fillEven(&even, size);
- var odd = try DynamicBitSetUnmanaged.initEmpty(allocator, size);
+ var odd: Dynamic = try .initEmpty(allocator, size);
defer odd.deinit(allocator);
fillOdd(&odd, size);
@@ -1790,13 +1807,13 @@ test DynamicBitSetUnmanaged {
}
}
-test DynamicBitSet {
+test DynamicManaged {
const allocator = std.testing.allocator;
- var a = try DynamicBitSet.initEmpty(allocator, 300);
+ var a: DynamicManaged = try .initEmpty(allocator, 300);
try testing.expectEqual(@as(usize, 0), a.count());
a.deinit();
- a = try DynamicBitSet.initEmpty(allocator, 0);
+ a = try .initEmpty(allocator, 0);
defer a.deinit();
for ([_]usize{ 1, 2, 31, 32, 33, 0, 65, 64, 63, 500, 254, 3000 }) |size| {
const old_len = a.capacity();
@@ -1822,7 +1839,7 @@ test DynamicBitSet {
}
try testing.expectEqual(@as(usize, 0), tmp.count());
- var b = try DynamicBitSet.initFull(allocator, size);
+ var b: DynamicManaged = try .initFull(allocator, size);
defer b.deinit();
try testing.expectEqual(@as(usize, size), b.count());
@@ -1831,10 +1848,10 @@ test DynamicBitSet {
}
}
-test StaticBitSet {
- try testing.expectEqual(IntegerBitSet(0), StaticBitSet(0));
- try testing.expectEqual(IntegerBitSet(5), StaticBitSet(5));
- try testing.expectEqual(IntegerBitSet(@bitSizeOf(usize)), StaticBitSet(@bitSizeOf(usize)));
- try testing.expectEqual(ArrayBitSet(usize, @bitSizeOf(usize) + 1), StaticBitSet(@bitSizeOf(usize) + 1));
- try testing.expectEqual(ArrayBitSet(usize, 500), StaticBitSet(500));
+test Static {
+ try testing.expectEqual(Integer(0), Static(0));
+ try testing.expectEqual(Integer(5), Static(5));
+ try testing.expectEqual(Integer(@bitSizeOf(usize)), Static(@bitSizeOf(usize)));
+ try testing.expectEqual(Array(usize, @bitSizeOf(usize) + 1), Static(@bitSizeOf(usize) + 1));
+ try testing.expectEqual(Array(usize, 500), Static(500));
}
diff --git a/lib/std/crypto/codecs/base64_hex_ct.zig b/lib/std/crypto/codecs/base64_hex_ct.zig
@@ -3,7 +3,7 @@
//! This is designed to be used in cryptographic applications where timing attacks are a concern.
const std = @import("std");
const testing = std.testing;
-const StaticBitSet = std.StaticBitSet;
+const StaticBitSet = std.bit_set.Static;
pub const Error = error{
/// An invalid character was found in the input.
diff --git a/lib/std/enums.zig b/lib/std/enums.zig
@@ -247,7 +247,7 @@ pub fn EnumSet(comptime E: type) type {
/// The element type for this set.
pub const Key = Indexer.Key;
- const BitSet = std.StaticBitSet(Indexer.count);
+ const BitSet = std.bit_set.Static(Indexer.count);
/// The maximum number of items in this set.
pub const len = Indexer.count;
@@ -445,7 +445,7 @@ pub fn EnumMap(comptime E: type, comptime V: type) type {
/// The number of possible keys in the map
pub const len = Indexer.count;
- const BitSet = std.StaticBitSet(Indexer.count);
+ const BitSet = std.bit_set.Static(Indexer.count);
/// Bits determining whether items are in the map
bits: BitSet = .empty,
diff --git a/lib/std/fs/path.zig b/lib/std/fs/path.zig
@@ -897,7 +897,7 @@ pub fn resolveWindows(allocator: Allocator, paths: []const []const u8) Allocator
var buf: [3]usize = undefined;
var bit_set_allocator_state: std.heap.BufferFirstAllocator = .init(@ptrCast(&buf), allocator);
const bit_set_allocator = bit_set_allocator_state.allocator();
- var relevant_paths = try std.bit_set.DynamicBitSetUnmanaged.initEmpty(bit_set_allocator, paths.len);
+ var relevant_paths: std.bit_set.Dynamic = try .initEmpty(bit_set_allocator, paths.len);
defer relevant_paths.deinit(bit_set_allocator);
// Iterate the paths backwards, marking the relevant paths along the way.
diff --git a/lib/std/std.zig b/lib/std/std.zig
@@ -9,7 +9,9 @@ pub const StaticStringMapWithEql = static_string_map.StaticStringMapWithEql;
pub const Deque = @import("deque.zig").Deque;
pub const DoublyLinkedList = @import("DoublyLinkedList.zig");
pub const DynLib = @import("dynamic_library.zig").DynLib;
+/// Deprecated: use `bit_set.DynamicManaged`.
pub const DynamicBitSet = bit_set.DynamicBitSet;
+/// Deprecated: use `bit_set.Dynamic`.
pub const DynamicBitSetUnmanaged = bit_set.DynamicBitSetUnmanaged;
pub const EnumArray = enums.EnumArray;
pub const EnumMap = enums.EnumMap;
@@ -24,6 +26,7 @@ pub const Progress = @import("Progress.zig");
pub const Random = @import("Random.zig");
pub const SemanticVersion = @import("SemanticVersion.zig");
pub const SinglyLinkedList = @import("SinglyLinkedList.zig");
+/// Deprecated: use `bit_set.Static`.
pub const StaticBitSet = bit_set.StaticBitSet;
pub const StringHashMap = hash_map.StringHashMap;
pub const StringHashMapUnmanaged = hash_map.StringHashMapUnmanaged;
diff --git a/lib/std/testing.zig b/lib/std/testing.zig
@@ -501,7 +501,7 @@ const BytesDiffer = struct {
var row: usize = 0;
while (expected_iterator.next()) |chunk| {
// to avoid having to calculate diffs twice per chunk
- var diffs: std.bit_set.IntegerBitSet(16) = .{ .mask = 0 };
+ var diffs: std.bit_set.Integer(16) = .{ .mask = 0 };
for (chunk, 0..) |byte, col| {
const absolute_byte_index = col + row * 16;
const diff = if (absolute_byte_index < self.actual.len) self.actual[absolute_byte_index] != byte else true;
diff --git a/src/Sema.zig b/src/Sema.zig
@@ -12319,7 +12319,7 @@ fn analyzeSwitchPayloadCapture(
// be several, and we can squash all of these cases into the same switch prong using
// a simple bitcast. We'll make this the 'else' prong.
- var in_mem_coercible: std.DynamicBitSet = try .initFull(sema.arena, field_indices.len);
+ var in_mem_coercible: std.bit_set.Dynamic = try .initFull(sema.arena, field_indices.len);
in_mem_coercible.unset(first_non_imc);
{
const next = first_non_imc + 1;
diff --git a/src/codegen/riscv64/CodeGen.zig b/src/codegen/riscv64/CodeGen.zig
@@ -92,7 +92,7 @@ scope_generation: u32,
/// which is a relative jump, based on the address following the reloc.
exitlude_jump_relocs: std.ArrayList(usize) = .empty,
-reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
+reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
/// Whenever there is a runtime branch, we push a Branch onto this stack,
/// and pop it off when the runtime branch joins. This provides an "overlay"
diff --git a/src/codegen/riscv64/Mir.zig b/src/codegen/riscv64/Mir.zig
@@ -238,7 +238,7 @@ const Immediate = bits.Immediate;
const Memory = bits.Memory;
const FrameIndex = bits.FrameIndex;
const FrameAddr = @import("CodeGen.zig").FrameAddr;
-const IntegerBitSet = std.bit_set.IntegerBitSet;
+const IntegerBitSet = std.bit_set.Integer;
const Mnemonic = @import("mnem.zig").Mnemonic;
const InternPool = @import("../../InternPool.zig");
diff --git a/src/codegen/sparc64/CodeGen.zig b/src/codegen/sparc64/CodeGen.zig
@@ -79,7 +79,7 @@ end_di_column: u32,
/// which is a relative jump, based on the address following the reloc.
exitlude_jump_relocs: std.ArrayList(usize) = .empty,
-reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
+reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
/// Whenever there is a runtime branch, we push a Branch onto this stack,
/// and pop it off when the runtime branch joins. This provides an "overlay"
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig
@@ -280,7 +280,7 @@ pub fn idBound(module: Module) Word {
pub fn addEntryPointDeps(
module: *Module,
decl_index: Decl.Index,
- seen: *std.DynamicBitSetUnmanaged,
+ seen: *std.bit_set.Dynamic,
interface: *std.array_list.Managed(Id),
) !void {
const decl = module.declPtr(decl_index);
@@ -310,7 +310,7 @@ fn entryPoints(module: *Module) !Section {
var interface = std.array_list.Managed(Id).init(module.gpa);
defer interface.deinit();
- var seen = try std.DynamicBitSetUnmanaged.initEmpty(module.gpa, module.decls.items.len);
+ var seen: std.bit_set.Dynamic = try .initEmpty(module.gpa, module.decls.items.len);
defer seen.deinit(module.gpa);
for (module.entry_points.keys(), module.entry_points.values()) |entry_point_id, entry_point| {
diff --git a/src/codegen/x86_64/CodeGen.zig b/src/codegen/x86_64/CodeGen.zig
@@ -129,7 +129,7 @@ mir_table: std.ArrayList(Mir.Inst.Index) = .empty,
/// which is a relative jump, based on the address following the reloc.
epilogue_relocs: std.ArrayList(Mir.Inst.Index) = .empty,
-reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
+reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
inst_tracking: InstTrackingMap = .empty,
// Key is the block instruction
@@ -177439,7 +177439,7 @@ fn airAsm(self: *CodeGen, inst: Air.Inst.Index) !void {
}
var mnem_size: struct {
- op_has_size: std.StaticBitSet(4),
+ op_has_size: std.bit_set.Static(4),
size: Memory.Size,
used: bool,
fn init(size: ?Memory.Size) @This() {
@@ -178378,7 +178378,7 @@ fn genCopy(self: *CodeGen, ty: Type, dst_mcv: MCValue, src_mcv: MCValue, opts: C
else => unreachable,
},
dst_tag => |src_regs| {
- var remaining: std.StaticBitSet(dst_regs.len) = .full;
+ var remaining: std.bit_set.Static(dst_regs.len) = .full;
var hazard_regs = src_regs;
while (!remaining.eql(.empty)) {
var remaining_it = remaining.iterator(.{});
@@ -187560,7 +187560,7 @@ const Temp = struct {
}
const max = std.math.maxInt(@typeInfo(Index).@"enum".tag_type);
- const Set = std.StaticBitSet(max);
+ const Set = std.bit_set.Static(max);
const SafetySet = if (std.debug.runtime_safety) Set else struct {
inline fn initEmpty() @This() {
return .{};
diff --git a/src/codegen/x86_64/Mir.zig b/src/codegen/x86_64/Mir.zig
@@ -1777,7 +1777,7 @@ pub const Inst = struct {
pub const RegisterList = struct {
bitset: BitSet,
- const BitSet = std.bit_set.IntegerBitSet(32);
+ const BitSet = std.bit_set.Integer(32);
const Self = @This();
pub const empty: RegisterList = .{ .bitset = .empty };
diff --git a/src/libs/freebsd.zig b/src/libs/freebsd.zig
@@ -541,8 +541,8 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye
var sym_i: usize = 0;
var sym_name_buf: std.Io.Writer.Allocating = .init(arena);
var opt_symbol_name: ?[]const u8 = null;
- var versions = try std.DynamicBitSetUnmanaged.initEmpty(arena, metadata.all_versions.len);
- var weak_linkages = try std.DynamicBitSetUnmanaged.initEmpty(arena, metadata.all_versions.len);
+ var versions: std.bit_set.Dynamic = try .initEmpty(arena, metadata.all_versions.len);
+ var weak_linkages: std.bit_set.Dynamic = try .initEmpty(arena, metadata.all_versions.len);
var inc_reader: std.Io.Reader = .fixed(metadata.inclusions);
diff --git a/src/link/SpirV/lower_invocation_globals.zig b/src/link/SpirV/lower_invocation_globals.zig
@@ -208,7 +208,7 @@ const ModuleInfo = struct {
/// For each function, extend the list of `invocation_globals` with the
/// invocation globals that ALL of its dependencies use.
fn resolveInvocationGlobalUsage(self: *ModuleInfo, arena: Allocator) !void {
- var seen = try std.DynamicBitSetUnmanaged.initEmpty(arena, self.functions.count());
+ var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.functions.count());
for (self.functions.keys()) |id| {
try self.resolveInvocationGlobalUsageStep(arena, id, &seen);
@@ -219,7 +219,7 @@ const ModuleInfo = struct {
self: *ModuleInfo,
arena: Allocator,
id: ResultId,
- seen: *std.DynamicBitSetUnmanaged,
+ seen: *std.bit_set.Dynamic,
) !void {
const index = self.functions.getIndex(id) orelse {
log.err("function calls invalid function {f}", .{id});
@@ -247,7 +247,7 @@ const ModuleInfo = struct {
self: *ModuleInfo,
arena: Allocator,
) !void {
- var seen = try std.DynamicBitSetUnmanaged.initEmpty(arena, self.invocation_globals.count());
+ var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.invocation_globals.count());
for (self.invocation_globals.keys()) |id| {
try self.resolveInvocationGlobalDependenciesStep(arena, id, &seen);
@@ -258,7 +258,7 @@ const ModuleInfo = struct {
self: *ModuleInfo,
arena: Allocator,
id: ResultId,
- seen: *std.DynamicBitSetUnmanaged,
+ seen: *std.bit_set.Dynamic,
) !void {
const index = self.invocation_globals.getIndex(id) orelse {
log.err("invalid invocation global {f}", .{id});
diff --git a/src/register_manager.zig b/src/register_manager.zig
@@ -4,7 +4,7 @@ const mem = std.mem;
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Air = @import("Air.zig");
-const StaticBitSet = std.bit_set.StaticBitSet;
+const StaticBitSet = std.bit_set.Static;
const Type = @import("Type.zig");
const Zcu = @import("Zcu.zig");
const expect = std.testing.expect;