authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2026-05-08 22:12:27+01:00
committergravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2026-05-08 22:12:27+01:00
log75c717bd064ac8cd21ee32b57b73b2a8673f1e41
tree5163a0ea2c2db8a499da67d611cafa1670beb8f5
parent33d2e571c763ca1f0d2d97803ece92b49a54aac5

std.bit_set, std.enums: Remove .init{Empty,Full}() in favor of .empty/.full


4 files changed, 4 insertions(+), 42 deletions(-)

lib/compiler/aro/backend/Ir/x86/Renderer.zig+3-3
......@@ -21,17 +21,17 @@ const RegisterManager = zig.RegisterManager(Renderer, Register, Ir.Ref, abi.allo
2121const RegisterBitSet = RegisterManager.RegisterBitSet;
2222const RegisterClass = struct {
2323 const gp: RegisterBitSet = blk: {
24 var set = RegisterBitSet.initEmpty();
24 var set: RegisterBitSet = .empty;
2525 for (abi.allocatable_regs, 0..) |reg, index| if (reg.class() == .general_purpose) set.set(index);
2626 break :blk set;
2727 };
2828 const x87: RegisterBitSet = blk: {
29 var set = RegisterBitSet.initEmpty();
29 var set: RegisterBitSet = .empty;
3030 for (abi.allocatable_regs, 0..) |reg, index| if (reg.class() == .x87) set.set(index);
3131 break :blk set;
3232 };
3333 const sse: RegisterBitSet = blk: {
34 var set = RegisterBitSet.initEmpty();
34 var set: RegisterBitSet = .empty;
3535 for (abi.allocatable_regs, 0..) |reg, index| if (reg.class() == .sse) set.set(index);
3636 break :blk set;
3737 };
lib/std/bit_set.zig-24
......@@ -73,18 +73,6 @@ pub fn Integer(comptime size: u16) type {
7373 /// The bit mask, as a single integer
7474 mask: MaskInt,
7575
76 /// Deprecated: use `.empty`.
77 /// Creates a bit set with no elements present.
78 pub fn initEmpty() Self {
79 return .{ .mask = 0 };
80 }
81
82 /// Deprecated: use `.full`.
83 /// Creates a bit set with all elements present.
84 pub fn initFull() Self {
85 return .{ .mask = ~@as(MaskInt, 0) };
86 }
87
8876 /// A bit set with no elements present.
8977 pub const empty: Self = .{ .mask = 0 };
9078
......@@ -403,18 +391,6 @@ pub fn Array(comptime MaskIntType: type, comptime size: usize) type {
403391 /// Padding bits at the end are undefined.
404392 masks: [num_masks]MaskInt,
405393
406 /// Deprecated: use `.empty`.
407 /// Creates a bit set with no elements present.
408 pub fn initEmpty() Self {
409 return .empty;
410 }
411
412 /// Deprecated: use `.full`.
413 /// Creates a bit set with all elements present.
414 pub fn initFull() Self {
415 return .full;
416 }
417
418394 /// A bit set with no elements present.
419395 pub const empty: Self = .{ .masks = @splat(0) };
420396
lib/std/enums.zig-12
......@@ -284,18 +284,6 @@ pub fn EnumSet(comptime E: type) type {
284284 /// A set containing all possible keys.
285285 pub const full: Self = .{ .bits = .full };
286286
287 /// Deprecated: use `.empty`.
288 /// Returns a set containing no keys.
289 pub fn initEmpty() Self {
290 return .empty;
291 }
292
293 /// Deprecated: use `.full`.
294 /// Returns a set containing all possible keys.
295 pub fn initFull() Self {
296 return .full;
297 }
298
299287 /// Returns a set containing multiple keys.
300288 pub fn initMany(keys: []const Key) Self {
301289 var set: Self = .empty;
src/codegen/x86_64/CodeGen.zig+1-3
......@@ -187562,9 +187562,7 @@ const Temp = struct {
187562187562 const max = std.math.maxInt(@typeInfo(Index).@"enum".tag_type);
187563187563 const Set = std.bit_set.Static(max);
187564187564 const SafetySet = if (std.debug.runtime_safety) Set else struct {
187565 inline fn initEmpty() @This() {
187566 return .{};
187567 }
187565 pub const empty: @This() = .{};
187568187566
187569187567 inline fn isSet(_: @This(), index: usize) bool {
187570187568 assert(index < max);