authorgravatar for me@gasinfinity.devGasInfinity <me@gasinfinity.dev> 2026-04-23 14:03:08+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-27 16:46:26+02:00
log1deb029a665399838ca0bfbc451af02bc091200f
tree183f1cff867ea74272083b5698e7fa8357fbc34b
parentc166c49b1917bb682d6949150feb59e54d6c0b2d

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.

19 files changed, 105 insertions(+), 85 deletions(-)

lib/compiler/resinator/compile.zig+1-1
......@@ -3084,7 +3084,7 @@ pub const StringTable = struct {
30843084
30853085 pub const Block = struct {
30863086 strings: std.ArrayList(Token) = .empty,
3087 set_indexes: std.bit_set.IntegerBitSet(16) = .{ .mask = 0 },
3087 set_indexes: std.bit_set.Integer(16) = .{ .mask = 0 },
30883088 memory_flags: MemoryFlags = MemoryFlags.defaults(res.RT.STRING),
30893089 characteristics: u32,
30903090 version: u32,
lib/std/Build/Step/ConfigHeader.zig+1-1
......@@ -290,7 +290,7 @@ fn render_autoconf_undef(
290290 const build = step.owner;
291291 const allocator = build.allocator;
292292
293 var is_used: std.DynamicBitSetUnmanaged = try .initEmpty(allocator, values.count());
293 var is_used: std.bit_set.Dynamic = try .initEmpty(allocator, values.count());
294294 defer is_used.deinit(allocator);
295295
296296 var any_errors = false;
lib/std/Io/Kqueue.zig+1-1
......@@ -79,7 +79,7 @@ const Fiber = struct {
7979 awaiter: ?*Fiber,
8080 queue_next: ?*Fiber,
8181 cancel_thread: ?*Thread,
82 awaiting_completions: std.StaticBitSet(3),
82 awaiting_completions: std.bit_set.Static(3),
8383
8484 const finished: ?*Fiber = @ptrFromInt(@alignOf(Thread));
8585
lib/std/bit_set.zig+76-59
......@@ -8,50 +8,55 @@
88//!
99//! There are five variants defined here:
1010//!
11//! IntegerBitSet:
11//! Integer:
1212//! A bit set with static size, which is backed by a single integer.
1313//! This set is good for sets with a small size, but may generate
1414//! inefficient code for larger sets, especially in debug mode.
1515//!
16//! ArrayBitSet:
16//! Array:
1717//! A bit set with static size, which is backed by an array of usize.
1818//! This set is good for sets with a larger size, but may use
1919//! more bytes than necessary if your set is small.
2020//!
21//! StaticBitSet:
22//! Picks either IntegerBitSet or ArrayBitSet depending on the requested
21//! Static:
22//! Picks either Integer or Array depending on the requested
2323//! size. The interfaces of these two types match exactly, except for fields.
2424//!
25//! DynamicBitSet:
25//! Dynamic:
2626//! A bit set with runtime-known size, backed by an allocated slice
2727//! of usize.
2828//!
29//! DynamicBitSetUnmanaged:
30//! A variant of DynamicBitSet which does not store a pointer to its
31//! allocator, in order to save space.
29//! DynamicManaged:
30//! A variant of Dynamic which stores an allocator, using it when needed.
3231
3332const std = @import("std.zig");
3433const assert = std.debug.assert;
3534const Allocator = std.mem.Allocator;
3635const builtin = @import("builtin");
3736
37/// Deprecated: use `Static`.
38pub const StaticBitSet = Static;
39
3840/// Returns the optimal static bit set type for the specified number
3941/// of elements: either `IntegerBitSet` or `ArrayBitSet`,
4042/// both of which fulfill the same interface.
4143/// The returned type will perform no allocations,
4244/// can be copied by value, and does not require deinitialization.
43pub fn StaticBitSet(comptime size: usize) type {
45pub fn Static(comptime size: usize) type {
4446 if (size <= @bitSizeOf(usize)) {
45 return IntegerBitSet(size);
47 return Integer(size);
4648 } else {
47 return ArrayBitSet(usize, size);
49 return Array(usize, size);
4850 }
4951}
5052
53/// Deprecated: use `Integer`.
54pub const IntegerBitSet = Integer;
55
5156/// A bit set with static size, which is backed by a single integer.
5257/// This set is good for sets with a small size, but may generate
5358/// inefficient code for larger sets, especially in debug mode.
54pub fn IntegerBitSet(comptime size: u16) type {
59pub fn Integer(comptime size: u16) type {
5560 return packed struct(MaskInt) {
5661 const Self = @This();
5762
......@@ -328,21 +333,24 @@ pub fn IntegerBitSet(comptime size: u16) type {
328333 };
329334}
330335
336/// Deprecated: use `Array`.
337pub const ArrayBitSet = Array;
338
331339/// A bit set with static size, which is backed by an array of usize.
332340/// This set is good for sets with a larger size, but may use
333341/// more bytes than necessary if your set is small.
334pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
342pub fn Array(comptime MaskIntType: type, comptime size: usize) type {
335343 const mask_info: std.builtin.Type = @typeInfo(MaskIntType);
336344
337345 // Make sure the mask int is indeed an int
338 if (mask_info != .int) @compileError("ArrayBitSet can only operate on integer masks, but was passed " ++ @typeName(MaskIntType));
346 if (mask_info != .int) @compileError("Array can only operate on integer masks, but was passed " ++ @typeName(MaskIntType));
339347
340348 // It must also be unsigned.
341 if (mask_info.int.signedness != .unsigned) @compileError("ArrayBitSet requires an unsigned integer mask type, but was passed " ++ @typeName(MaskIntType));
349 if (mask_info.int.signedness != .unsigned) @compileError("Array requires an unsigned integer mask type, but was passed " ++ @typeName(MaskIntType));
342350
343351 // And it must not be empty.
344352 if (MaskIntType == u0)
345 @compileError("ArrayBitSet requires a sized integer for its mask int. u0 does not work.");
353 @compileError("Array requires a sized integer for its mask int. u0 does not work.");
346354
347355 const byte_size = std.mem.byte_size_in_bits;
348356
......@@ -352,7 +360,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
352360 var desired_bits = std.math.ceilPowerOfTwoAssert(usize, @bitSizeOf(MaskIntType));
353361 if (desired_bits < byte_size) desired_bits = byte_size;
354362 const FixedMaskType = std.meta.Int(.unsigned, desired_bits);
355 @compileError("ArrayBitSet was passed integer type " ++ @typeName(MaskIntType) ++
363 @compileError("Array was passed integer type " ++ @typeName(MaskIntType) ++
356364 ", which is not a power of two. Please round this up to a power of two integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
357365 }
358366
......@@ -363,7 +371,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
363371 var desired_bits = @sizeOf(MaskIntType) * byte_size;
364372 desired_bits = std.math.ceilPowerOfTwoAssert(usize, desired_bits);
365373 const FixedMaskType = std.meta.Int(.unsigned, desired_bits);
366 @compileError("ArrayBitSet was passed integer type " ++ @typeName(MaskIntType) ++
374 @compileError("Array was passed integer type " ++ @typeName(MaskIntType) ++
367375 ", which contains padding bits. Please round this up to an unpadded integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
368376 }
369377
......@@ -673,7 +681,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
673681 }
674682
675683 pub fn Iterator(comptime options: IteratorOptions) type {
676 return BitSetIterator(MaskInt, options);
684 return GenericIterator(MaskInt, options);
677685 }
678686
679687 fn maskBit(index: usize) MaskInt {
......@@ -688,9 +696,12 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
688696 };
689697}
690698
699/// Deprecated: use `Dynamic`.
700pub const DynamicBitSetUnmanaged = Dynamic;
701
691702/// A bit set with runtime-known size, backed by an allocated slice
692703/// of usize. The allocator must be tracked externally by the user.
693pub const DynamicBitSetUnmanaged = struct {
704pub const Dynamic = struct {
694705 const Self = @This();
695706
696707 /// The integer type used to represent a mask in this bit set
......@@ -1074,7 +1085,7 @@ pub const DynamicBitSetUnmanaged = struct {
10741085 }
10751086
10761087 pub fn Iterator(comptime options: IteratorOptions) type {
1077 return BitSetIterator(MaskInt, options);
1088 return GenericIterator(MaskInt, options);
10781089 }
10791090
10801091 fn maskBit(index: usize) MaskInt {
......@@ -1091,10 +1102,16 @@ pub const DynamicBitSetUnmanaged = struct {
10911102 }
10921103};
10931104
1105/// Deprecated: use `DynamicManaged` or `Dynamic` (will need to update callsites).
1106pub const DynamicBitSet = DynamicManaged;
1107
10941108/// A bit set with runtime-known size, backed by an allocated slice
1095/// of usize. Thin wrapper around DynamicBitSetUnmanaged which keeps
1109/// of usize. Thin wrapper around Dynamic which keeps
10961110/// track of the allocator instance.
1097pub const DynamicBitSet = struct {
1111///
1112/// Deprecated in favor of `Dynamic` which accepts an `Allocator`
1113/// as a parameter when needed instead of storing it.
1114pub const DynamicManaged = struct {
10981115 const Self = @This();
10991116
11001117 /// The integer type used to represent a mask in this bit set
......@@ -1104,12 +1121,12 @@ pub const DynamicBitSet = struct {
11041121 pub const ShiftInt = std.math.Log2Int(MaskInt);
11051122
11061123 allocator: Allocator,
1107 unmanaged: DynamicBitSetUnmanaged = .{},
1124 unmanaged: Dynamic = .{},
11081125
11091126 /// Creates a bit set with no elements present.
11101127 pub fn initEmpty(allocator: Allocator, bit_length: usize) !Self {
11111128 return Self{
1112 .unmanaged = try DynamicBitSetUnmanaged.initEmpty(allocator, bit_length),
1129 .unmanaged = try .initEmpty(allocator, bit_length),
11131130 .allocator = allocator,
11141131 };
11151132 }
......@@ -1117,7 +1134,7 @@ pub const DynamicBitSet = struct {
11171134 /// Creates a bit set with all elements present.
11181135 pub fn initFull(allocator: Allocator, bit_length: usize) !Self {
11191136 return Self{
1120 .unmanaged = try DynamicBitSetUnmanaged.initFull(allocator, bit_length),
1137 .unmanaged = try .initFull(allocator, bit_length),
11211138 .allocator = allocator,
11221139 };
11231140 }
......@@ -1247,7 +1264,7 @@ pub const DynamicBitSet = struct {
12471264 return self.unmanaged.iterator(options);
12481265 }
12491266
1250 pub const Iterator = DynamicBitSetUnmanaged.Iterator;
1267 pub const Iterator = Dynamic.Iterator;
12511268};
12521269
12531270/// Options for configuring an iterator over a bit set
......@@ -1274,7 +1291,7 @@ pub const IteratorOptions = struct {
12741291};
12751292
12761293// The iterator is reusable between several bit set types
1277fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) type {
1294fn GenericIterator(comptime MaskInt: type, comptime options: IteratorOptions) type {
12781295 const ShiftInt = std.math.Log2Int(MaskInt);
12791296 const kind = options.kind;
12801297 const direction = options.direction;
......@@ -1713,37 +1730,37 @@ fn testStaticBitSet(comptime Set: type) !void {
17131730 try testPureBitSet(Set);
17141731}
17151732
1716test IntegerBitSet {
1733test Integer {
17171734 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
17181735 if (comptime builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24300
17191736
1720 try testStaticBitSet(IntegerBitSet(0));
1721 try testStaticBitSet(IntegerBitSet(1));
1722 try testStaticBitSet(IntegerBitSet(2));
1723 try testStaticBitSet(IntegerBitSet(5));
1724 try testStaticBitSet(IntegerBitSet(8));
1725 try testStaticBitSet(IntegerBitSet(32));
1726 try testStaticBitSet(IntegerBitSet(64));
1727 try testStaticBitSet(IntegerBitSet(127));
1737 try testStaticBitSet(Integer(0));
1738 try testStaticBitSet(Integer(1));
1739 try testStaticBitSet(Integer(2));
1740 try testStaticBitSet(Integer(5));
1741 try testStaticBitSet(Integer(8));
1742 try testStaticBitSet(Integer(32));
1743 try testStaticBitSet(Integer(64));
1744 try testStaticBitSet(Integer(127));
17281745}
17291746
1730test ArrayBitSet {
1747test Array {
17311748 inline for (.{ 0, 1, 2, 31, 32, 33, 63, 64, 65, 254, 500, 3000 }) |size| {
1732 try testStaticBitSet(ArrayBitSet(u8, size));
1733 try testStaticBitSet(ArrayBitSet(u16, size));
1734 try testStaticBitSet(ArrayBitSet(u32, size));
1735 try testStaticBitSet(ArrayBitSet(u64, size));
1736 try testStaticBitSet(ArrayBitSet(u128, size));
1749 try testStaticBitSet(Array(u8, size));
1750 try testStaticBitSet(Array(u16, size));
1751 try testStaticBitSet(Array(u32, size));
1752 try testStaticBitSet(Array(u64, size));
1753 try testStaticBitSet(Array(u128, size));
17371754 }
17381755}
17391756
1740test DynamicBitSetUnmanaged {
1757test Dynamic {
17411758 const allocator = std.testing.allocator;
1742 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);
1759 var a: Dynamic = try .initEmpty(allocator, 300);
17431760 try testing.expectEqual(@as(usize, 0), a.count());
17441761 a.deinit(allocator);
17451762
1746 a = try DynamicBitSetUnmanaged.initEmpty(allocator, 0);
1763 a = try .initEmpty(allocator, 0);
17471764 defer a.deinit(allocator);
17481765 for ([_]usize{ 1, 2, 31, 32, 33, 0, 65, 64, 63, 500, 254, 3000 }) |size| {
17491766 const old_len = a.capacity();
......@@ -1769,17 +1786,17 @@ test DynamicBitSetUnmanaged {
17691786 }
17701787 try testing.expectEqual(@as(usize, 0), empty.count());
17711788
1772 var full = try DynamicBitSetUnmanaged.initFull(allocator, size);
1789 var full: Dynamic = try .initFull(allocator, size);
17731790 defer full.deinit(allocator);
17741791 try testing.expectEqual(@as(usize, size), full.count());
17751792
17761793 try testEql(empty, full, size);
17771794 {
1778 var even = try DynamicBitSetUnmanaged.initEmpty(allocator, size);
1795 var even: Dynamic = try .initEmpty(allocator, size);
17791796 defer even.deinit(allocator);
17801797 fillEven(&even, size);
17811798
1782 var odd = try DynamicBitSetUnmanaged.initEmpty(allocator, size);
1799 var odd: Dynamic = try .initEmpty(allocator, size);
17831800 defer odd.deinit(allocator);
17841801 fillOdd(&odd, size);
17851802
......@@ -1790,13 +1807,13 @@ test DynamicBitSetUnmanaged {
17901807 }
17911808}
17921809
1793test DynamicBitSet {
1810test DynamicManaged {
17941811 const allocator = std.testing.allocator;
1795 var a = try DynamicBitSet.initEmpty(allocator, 300);
1812 var a: DynamicManaged = try .initEmpty(allocator, 300);
17961813 try testing.expectEqual(@as(usize, 0), a.count());
17971814 a.deinit();
17981815
1799 a = try DynamicBitSet.initEmpty(allocator, 0);
1816 a = try .initEmpty(allocator, 0);
18001817 defer a.deinit();
18011818 for ([_]usize{ 1, 2, 31, 32, 33, 0, 65, 64, 63, 500, 254, 3000 }) |size| {
18021819 const old_len = a.capacity();
......@@ -1822,7 +1839,7 @@ test DynamicBitSet {
18221839 }
18231840 try testing.expectEqual(@as(usize, 0), tmp.count());
18241841
1825 var b = try DynamicBitSet.initFull(allocator, size);
1842 var b: DynamicManaged = try .initFull(allocator, size);
18261843 defer b.deinit();
18271844 try testing.expectEqual(@as(usize, size), b.count());
18281845
......@@ -1831,10 +1848,10 @@ test DynamicBitSet {
18311848 }
18321849}
18331850
1834test StaticBitSet {
1835 try testing.expectEqual(IntegerBitSet(0), StaticBitSet(0));
1836 try testing.expectEqual(IntegerBitSet(5), StaticBitSet(5));
1837 try testing.expectEqual(IntegerBitSet(@bitSizeOf(usize)), StaticBitSet(@bitSizeOf(usize)));
1838 try testing.expectEqual(ArrayBitSet(usize, @bitSizeOf(usize) + 1), StaticBitSet(@bitSizeOf(usize) + 1));
1839 try testing.expectEqual(ArrayBitSet(usize, 500), StaticBitSet(500));
1851test Static {
1852 try testing.expectEqual(Integer(0), Static(0));
1853 try testing.expectEqual(Integer(5), Static(5));
1854 try testing.expectEqual(Integer(@bitSizeOf(usize)), Static(@bitSizeOf(usize)));
1855 try testing.expectEqual(Array(usize, @bitSizeOf(usize) + 1), Static(@bitSizeOf(usize) + 1));
1856 try testing.expectEqual(Array(usize, 500), Static(500));
18401857}
lib/std/crypto/codecs/base64_hex_ct.zig+1-1
......@@ -3,7 +3,7 @@
33//! This is designed to be used in cryptographic applications where timing attacks are a concern.
44const std = @import("std");
55const testing = std.testing;
6const StaticBitSet = std.StaticBitSet;
6const StaticBitSet = std.bit_set.Static;
77
88pub const Error = error{
99 /// An invalid character was found in the input.
lib/std/enums.zig+2-2
......@@ -247,7 +247,7 @@ pub fn EnumSet(comptime E: type) type {
247247 /// The element type for this set.
248248 pub const Key = Indexer.Key;
249249
250 const BitSet = std.StaticBitSet(Indexer.count);
250 const BitSet = std.bit_set.Static(Indexer.count);
251251
252252 /// The maximum number of items in this set.
253253 pub const len = Indexer.count;
......@@ -445,7 +445,7 @@ pub fn EnumMap(comptime E: type, comptime V: type) type {
445445 /// The number of possible keys in the map
446446 pub const len = Indexer.count;
447447
448 const BitSet = std.StaticBitSet(Indexer.count);
448 const BitSet = std.bit_set.Static(Indexer.count);
449449
450450 /// Bits determining whether items are in the map
451451 bits: BitSet = .empty,
lib/std/fs/path.zig+1-1
......@@ -897,7 +897,7 @@ pub fn resolveWindows(allocator: Allocator, paths: []const []const u8) Allocator
897897 var buf: [3]usize = undefined;
898898 var bit_set_allocator_state: std.heap.BufferFirstAllocator = .init(@ptrCast(&buf), allocator);
899899 const bit_set_allocator = bit_set_allocator_state.allocator();
900 var relevant_paths = try std.bit_set.DynamicBitSetUnmanaged.initEmpty(bit_set_allocator, paths.len);
900 var relevant_paths: std.bit_set.Dynamic = try .initEmpty(bit_set_allocator, paths.len);
901901 defer relevant_paths.deinit(bit_set_allocator);
902902
903903 // Iterate the paths backwards, marking the relevant paths along the way.
lib/std/std.zig+3
......@@ -9,7 +9,9 @@ pub const StaticStringMapWithEql = static_string_map.StaticStringMapWithEql;
99pub const Deque = @import("deque.zig").Deque;
1010pub const DoublyLinkedList = @import("DoublyLinkedList.zig");
1111pub const DynLib = @import("dynamic_library.zig").DynLib;
12/// Deprecated: use `bit_set.DynamicManaged`.
1213pub const DynamicBitSet = bit_set.DynamicBitSet;
14/// Deprecated: use `bit_set.Dynamic`.
1315pub const DynamicBitSetUnmanaged = bit_set.DynamicBitSetUnmanaged;
1416pub const EnumArray = enums.EnumArray;
1517pub const EnumMap = enums.EnumMap;
......@@ -24,6 +26,7 @@ pub const Progress = @import("Progress.zig");
2426pub const Random = @import("Random.zig");
2527pub const SemanticVersion = @import("SemanticVersion.zig");
2628pub const SinglyLinkedList = @import("SinglyLinkedList.zig");
29/// Deprecated: use `bit_set.Static`.
2730pub const StaticBitSet = bit_set.StaticBitSet;
2831pub const StringHashMap = hash_map.StringHashMap;
2932pub const StringHashMapUnmanaged = hash_map.StringHashMapUnmanaged;
lib/std/testing.zig+1-1
......@@ -501,7 +501,7 @@ const BytesDiffer = struct {
501501 var row: usize = 0;
502502 while (expected_iterator.next()) |chunk| {
503503 // to avoid having to calculate diffs twice per chunk
504 var diffs: std.bit_set.IntegerBitSet(16) = .{ .mask = 0 };
504 var diffs: std.bit_set.Integer(16) = .{ .mask = 0 };
505505 for (chunk, 0..) |byte, col| {
506506 const absolute_byte_index = col + row * 16;
507507 const diff = if (absolute_byte_index < self.actual.len) self.actual[absolute_byte_index] != byte else true;
src/Sema.zig+1-1
......@@ -12319,7 +12319,7 @@ fn analyzeSwitchPayloadCapture(
1231912319 // be several, and we can squash all of these cases into the same switch prong using
1232012320 // a simple bitcast. We'll make this the 'else' prong.
1232112321
12322 var in_mem_coercible: std.DynamicBitSet = try .initFull(sema.arena, field_indices.len);
12322 var in_mem_coercible: std.bit_set.Dynamic = try .initFull(sema.arena, field_indices.len);
1232312323 in_mem_coercible.unset(first_non_imc);
1232412324 {
1232512325 const next = first_non_imc + 1;
src/codegen/riscv64/CodeGen.zig+1-1
......@@ -92,7 +92,7 @@ scope_generation: u32,
9292/// which is a relative jump, based on the address following the reloc.
9393exitlude_jump_relocs: std.ArrayList(usize) = .empty,
9494
95reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
95reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
9696
9797/// Whenever there is a runtime branch, we push a Branch onto this stack,
9898/// and pop it off when the runtime branch joins. This provides an "overlay"
src/codegen/riscv64/Mir.zig+1-1
......@@ -238,7 +238,7 @@ const Immediate = bits.Immediate;
238238const Memory = bits.Memory;
239239const FrameIndex = bits.FrameIndex;
240240const FrameAddr = @import("CodeGen.zig").FrameAddr;
241const IntegerBitSet = std.bit_set.IntegerBitSet;
241const IntegerBitSet = std.bit_set.Integer;
242242const Mnemonic = @import("mnem.zig").Mnemonic;
243243
244244const InternPool = @import("../../InternPool.zig");
src/codegen/sparc64/CodeGen.zig+1-1
......@@ -79,7 +79,7 @@ end_di_column: u32,
7979/// which is a relative jump, based on the address following the reloc.
8080exitlude_jump_relocs: std.ArrayList(usize) = .empty,
8181
82reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
82reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
8383
8484/// Whenever there is a runtime branch, we push a Branch onto this stack,
8585/// and pop it off when the runtime branch joins. This provides an "overlay"
src/codegen/spirv/Module.zig+2-2
......@@ -280,7 +280,7 @@ pub fn idBound(module: Module) Word {
280280pub fn addEntryPointDeps(
281281 module: *Module,
282282 decl_index: Decl.Index,
283 seen: *std.DynamicBitSetUnmanaged,
283 seen: *std.bit_set.Dynamic,
284284 interface: *std.array_list.Managed(Id),
285285) !void {
286286 const decl = module.declPtr(decl_index);
......@@ -310,7 +310,7 @@ fn entryPoints(module: *Module) !Section {
310310 var interface = std.array_list.Managed(Id).init(module.gpa);
311311 defer interface.deinit();
312312
313 var seen = try std.DynamicBitSetUnmanaged.initEmpty(module.gpa, module.decls.items.len);
313 var seen: std.bit_set.Dynamic = try .initEmpty(module.gpa, module.decls.items.len);
314314 defer seen.deinit(module.gpa);
315315
316316 for (module.entry_points.keys(), module.entry_points.values()) |entry_point_id, entry_point| {
src/codegen/x86_64/CodeGen.zig+4-4
......@@ -129,7 +129,7 @@ mir_table: std.ArrayList(Mir.Inst.Index) = .empty,
129129/// which is a relative jump, based on the address following the reloc.
130130epilogue_relocs: std.ArrayList(Mir.Inst.Index) = .empty,
131131
132reused_operands: std.StaticBitSet(Air.Liveness.bpi - 1) = undefined,
132reused_operands: std.bit_set.Static(Air.Liveness.bpi - 1) = undefined,
133133inst_tracking: InstTrackingMap = .empty,
134134
135135// Key is the block instruction
......@@ -177439,7 +177439,7 @@ fn airAsm(self: *CodeGen, inst: Air.Inst.Index) !void {
177439177439 }
177440177440
177441177441 var mnem_size: struct {
177442 op_has_size: std.StaticBitSet(4),
177442 op_has_size: std.bit_set.Static(4),
177443177443 size: Memory.Size,
177444177444 used: bool,
177445177445 fn init(size: ?Memory.Size) @This() {
......@@ -178378,7 +178378,7 @@ fn genCopy(self: *CodeGen, ty: Type, dst_mcv: MCValue, src_mcv: MCValue, opts: C
178378178378 else => unreachable,
178379178379 },
178380178380 dst_tag => |src_regs| {
178381 var remaining: std.StaticBitSet(dst_regs.len) = .full;
178381 var remaining: std.bit_set.Static(dst_regs.len) = .full;
178382178382 var hazard_regs = src_regs;
178383178383 while (!remaining.eql(.empty)) {
178384178384 var remaining_it = remaining.iterator(.{});
......@@ -187560,7 +187560,7 @@ const Temp = struct {
187560187560 }
187561187561
187562187562 const max = std.math.maxInt(@typeInfo(Index).@"enum".tag_type);
187563 const Set = std.StaticBitSet(max);
187563 const Set = std.bit_set.Static(max);
187564187564 const SafetySet = if (std.debug.runtime_safety) Set else struct {
187565187565 inline fn initEmpty() @This() {
187566187566 return .{};
src/codegen/x86_64/Mir.zig+1-1
......@@ -1777,7 +1777,7 @@ pub const Inst = struct {
17771777pub const RegisterList = struct {
17781778 bitset: BitSet,
17791779
1780 const BitSet = std.bit_set.IntegerBitSet(32);
1780 const BitSet = std.bit_set.Integer(32);
17811781 const Self = @This();
17821782
17831783 pub const empty: RegisterList = .{ .bitset = .empty };
src/libs/freebsd.zig+2-2
......@@ -541,8 +541,8 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye
541541 var sym_i: usize = 0;
542542 var sym_name_buf: std.Io.Writer.Allocating = .init(arena);
543543 var opt_symbol_name: ?[]const u8 = null;
544 var versions = try std.DynamicBitSetUnmanaged.initEmpty(arena, metadata.all_versions.len);
545 var weak_linkages = try std.DynamicBitSetUnmanaged.initEmpty(arena, metadata.all_versions.len);
544 var versions: std.bit_set.Dynamic = try .initEmpty(arena, metadata.all_versions.len);
545 var weak_linkages: std.bit_set.Dynamic = try .initEmpty(arena, metadata.all_versions.len);
546546
547547 var inc_reader: std.Io.Reader = .fixed(metadata.inclusions);
548548
src/link/SpirV/lower_invocation_globals.zig+4-4
......@@ -208,7 +208,7 @@ const ModuleInfo = struct {
208208 /// For each function, extend the list of `invocation_globals` with the
209209 /// invocation globals that ALL of its dependencies use.
210210 fn resolveInvocationGlobalUsage(self: *ModuleInfo, arena: Allocator) !void {
211 var seen = try std.DynamicBitSetUnmanaged.initEmpty(arena, self.functions.count());
211 var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.functions.count());
212212
213213 for (self.functions.keys()) |id| {
214214 try self.resolveInvocationGlobalUsageStep(arena, id, &seen);
......@@ -219,7 +219,7 @@ const ModuleInfo = struct {
219219 self: *ModuleInfo,
220220 arena: Allocator,
221221 id: ResultId,
222 seen: *std.DynamicBitSetUnmanaged,
222 seen: *std.bit_set.Dynamic,
223223 ) !void {
224224 const index = self.functions.getIndex(id) orelse {
225225 log.err("function calls invalid function {f}", .{id});
......@@ -247,7 +247,7 @@ const ModuleInfo = struct {
247247 self: *ModuleInfo,
248248 arena: Allocator,
249249 ) !void {
250 var seen = try std.DynamicBitSetUnmanaged.initEmpty(arena, self.invocation_globals.count());
250 var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.invocation_globals.count());
251251
252252 for (self.invocation_globals.keys()) |id| {
253253 try self.resolveInvocationGlobalDependenciesStep(arena, id, &seen);
......@@ -258,7 +258,7 @@ const ModuleInfo = struct {
258258 self: *ModuleInfo,
259259 arena: Allocator,
260260 id: ResultId,
261 seen: *std.DynamicBitSetUnmanaged,
261 seen: *std.bit_set.Dynamic,
262262 ) !void {
263263 const index = self.invocation_globals.getIndex(id) orelse {
264264 log.err("invalid invocation global {f}", .{id});
src/register_manager.zig+1-1
......@@ -4,7 +4,7 @@ const mem = std.mem;
44const assert = std.debug.assert;
55const Allocator = std.mem.Allocator;
66const Air = @import("Air.zig");
7const StaticBitSet = std.bit_set.StaticBitSet;
7const StaticBitSet = std.bit_set.Static;
88const Type = @import("Type.zig");
99const Zcu = @import("Zcu.zig");
1010const expect = std.testing.expect;