authorgravatar for hemisputnik@proton.mehemisputnik <hemisputnik@proton.me> 2026-08-09 11:12:22+03:00
committergravatar for hemisputnik@proton.mehemisputnik <hemisputnik@proton.me> 2026-08-10 11:17:07+03:00
log27bf90f12b70c427411779c4fed99a6288c43710
tree52a146c4f7d69091db8fbf34492feb43fb792a14
parentaf6ee1a799bf01d55a36717999be1caf22fa8000
signaturebadge-check Signed by SSH key SHA256:iUK/EffQPyeXTXChJNV0UrxsscinNLxnk+0pu4OGU7Q

std.Build.Configuration: use IndexType where appropriate


1 files changed, 7 insertions(+), 49 deletions(-)

lib/std/Build/Configuration.zig+7-49
......@@ -1515,13 +1515,7 @@ pub const LazyPath = union(@This().Tag) {
15151515 };
15161516
15171517 /// An index into `extra`.
1518 pub const Index = enum(u32) {
1519 _,
1520
1521 pub fn get(this: @This(), c: *const Configuration) LazyPath {
1522 return extraData(c, LazyPath, @backingInt(this));
1523 }
1524 };
1518 pub const Index = IndexType(@This());
15251519
15261520 /// An index into `extra`, or `null`.
15271521 pub const OptionalIndex = enum(u32) {
......@@ -1746,13 +1740,7 @@ pub const Module = struct {
17461740 }
17471741 };
17481742
1749 pub const Index = enum(u32) {
1750 _,
1751
1752 pub fn get(this: @This(), c: *const Configuration) Module {
1753 return extraData(c, Module, @backingInt(this));
1754 }
1755 };
1743 pub const Index = IndexType(@This());
17561744
17571745 pub const Flags = packed struct(u32) {
17581746 optimize: Optimize,
......@@ -2051,13 +2039,7 @@ pub const SystemLib = struct {
20512039 name: String,
20522040 flags: Flags,
20532041
2054 pub const Index = enum(u32) {
2055 _,
2056
2057 pub fn get(this: @This(), c: *const Configuration) SystemLib {
2058 return extraData(c, SystemLib, @backingInt(this));
2059 }
2060 };
2042 pub const Index = IndexType(@This());
20612043
20622044 pub const UsePkgConfig = enum(u2) {
20632045 /// Don't use pkg-config, just pass -lfoo where foo is name.
......@@ -2090,13 +2072,7 @@ pub const CSourceFiles = struct {
20902072 args: Storage.FlagList(.flags, .args_len, String),
20912073 sub_paths: Storage.LengthPrefixedList(String),
20922074
2093 pub const Index = enum(u32) {
2094 _,
2095
2096 pub fn get(this: @This(), c: *const Configuration) CSourceFiles {
2097 return extraData(c, CSourceFiles, @backingInt(this));
2098 }
2099 };
2075 pub const Index = IndexType(@This());
21002076
21012077 pub const Flags = packed struct(u32) {
21022078 /// C compiler CLI flags.
......@@ -2110,13 +2086,7 @@ pub const CSourceFile = struct {
21102086 file: LazyPath.Index,
21112087 args: Storage.FlagList(.flags, .args_len, String),
21122088
2113 pub const Index = enum(u32) {
2114 _,
2115
2116 pub fn get(this: @This(), c: *const Configuration) CSourceFile {
2117 return extraData(c, CSourceFile, @backingInt(this));
2118 }
2119 };
2089 pub const Index = IndexType(@This());
21202090
21212091 pub const Flags = packed struct(u32) {
21222092 /// C compiler CLI flags.
......@@ -2131,13 +2101,7 @@ pub const RcSourceFile = struct {
21312101 args: Storage.FlagList(.flags, .args_len, String),
21322102 include_paths: Storage.FlagLengthPrefixedList(.flags, .include_paths, LazyPath.Index),
21332103
2134 pub const Index = enum(u32) {
2135 _,
2136
2137 pub fn get(this: @This(), c: *const Configuration) RcSourceFile {
2138 return extraData(c, RcSourceFile, @backingInt(this));
2139 }
2140 };
2104 pub const Index = IndexType(@This());
21412105
21422106 pub const Flags = packed struct(u32) {
21432107 /// C compiler CLI flags.
......@@ -2176,13 +2140,7 @@ pub const ResolvedTarget = struct {
21762140 /// defaults will be resolved.
21772141 result: TargetQuery.Index,
21782142
2179 pub const Index = enum(u32) {
2180 _,
2181
2182 pub fn get(this: @This(), c: *const Configuration) ResolvedTarget {
2183 return extraData(c, ResolvedTarget, @backingInt(this));
2184 }
2185 };
2143 pub const Index = IndexType(@This());
21862144
21872145 pub const OptionalIndex = enum(u32) {
21882146 none = max_u32,