@@ -853,8 +853,6 @@ pub const EmitH = struct {
853
853
pub const ErrorSet = struct {
854
854
/// The Decl that corresponds to the error set itself.
855
855
owner_decl : Decl.Index ,
856
- /// Offset from Decl node index, points to the error set AST node.
857
- node_offset : i32 ,
858
856
/// The string bytes are stored in the owner Decl arena.
859
857
/// These must be in sorted order. See sortNames.
860
858
names : NameMap ,
@@ -866,7 +864,7 @@ pub const ErrorSet = struct {
866
864
return .{
867
865
.file_scope = owner_decl .getFileScope (),
868
866
.parent_decl_node = owner_decl .src_node ,
869
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
867
+ .lazy = LazySrcLoc .nodeOffset (0 ),
870
868
};
871
869
}
872
870
@@ -893,8 +891,6 @@ pub const Struct = struct {
893
891
namespace : Namespace ,
894
892
/// The Decl that corresponds to the struct itself.
895
893
owner_decl : Decl.Index ,
896
- /// Offset from `owner_decl`, points to the struct AST node.
897
- node_offset : i32 ,
898
894
/// Index of the struct_decl ZIR instruction.
899
895
zir_index : Zir.Inst.Index ,
900
896
@@ -953,7 +949,7 @@ pub const Struct = struct {
953
949
return .{
954
950
.file_scope = owner_decl .getFileScope (),
955
951
.parent_decl_node = owner_decl .src_node ,
956
- .lazy = LazySrcLoc .nodeOffset (s . node_offset ),
952
+ .lazy = LazySrcLoc .nodeOffset (0 ),
957
953
};
958
954
}
959
955
@@ -968,7 +964,7 @@ pub const Struct = struct {
968
964
});
969
965
return s .srcLoc (mod );
970
966
};
971
- const node = owner_decl .relativeToNodeIndex (s . node_offset );
967
+ const node = owner_decl .relativeToNodeIndex (0 );
972
968
const node_tags = tree .nodes .items (.tag );
973
969
switch (node_tags [node ]) {
974
970
.container_decl ,
@@ -1060,8 +1056,6 @@ pub const Struct = struct {
1060
1056
pub const EnumSimple = struct {
1061
1057
/// The Decl that corresponds to the enum itself.
1062
1058
owner_decl : Decl.Index ,
1063
- /// Offset from `owner_decl`, points to the enum decl AST node.
1064
- node_offset : i32 ,
1065
1059
/// Set of field names in declaration order.
1066
1060
fields : NameMap ,
1067
1061
@@ -1072,7 +1066,7 @@ pub const EnumSimple = struct {
1072
1066
return .{
1073
1067
.file_scope = owner_decl .getFileScope (),
1074
1068
.parent_decl_node = owner_decl .src_node ,
1075
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
1069
+ .lazy = LazySrcLoc .nodeOffset (0 ),
1076
1070
};
1077
1071
}
1078
1072
};
@@ -1083,8 +1077,6 @@ pub const EnumSimple = struct {
1083
1077
pub const EnumNumbered = struct {
1084
1078
/// The Decl that corresponds to the enum itself.
1085
1079
owner_decl : Decl.Index ,
1086
- /// Offset from `owner_decl`, points to the enum decl AST node.
1087
- node_offset : i32 ,
1088
1080
/// An integer type which is used for the numerical value of the enum.
1089
1081
/// Whether zig chooses this type or the user specifies it, it is stored here.
1090
1082
tag_ty : Type ,
@@ -1103,7 +1095,7 @@ pub const EnumNumbered = struct {
1103
1095
return .{
1104
1096
.file_scope = owner_decl .getFileScope (),
1105
1097
.parent_decl_node = owner_decl .src_node ,
1106
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
1098
+ .lazy = LazySrcLoc .nodeOffset (0 ),
1107
1099
};
1108
1100
}
1109
1101
};
@@ -1113,8 +1105,6 @@ pub const EnumNumbered = struct {
1113
1105
pub const EnumFull = struct {
1114
1106
/// The Decl that corresponds to the enum itself.
1115
1107
owner_decl : Decl.Index ,
1116
- /// Offset from `owner_decl`, points to the enum decl AST node.
1117
- node_offset : i32 ,
1118
1108
/// An integer type which is used for the numerical value of the enum.
1119
1109
/// Whether zig chooses this type or the user specifies it, it is stored here.
1120
1110
tag_ty : Type ,
@@ -1137,7 +1127,7 @@ pub const EnumFull = struct {
1137
1127
return .{
1138
1128
.file_scope = owner_decl .getFileScope (),
1139
1129
.parent_decl_node = owner_decl .src_node ,
1140
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
1130
+ .lazy = LazySrcLoc .nodeOffset (0 ),
1141
1131
};
1142
1132
}
1143
1133
};
@@ -1155,8 +1145,6 @@ pub const Union = struct {
1155
1145
namespace : Namespace ,
1156
1146
/// The Decl that corresponds to the union itself.
1157
1147
owner_decl : Decl.Index ,
1158
- /// Offset from `owner_decl`, points to the union decl AST node.
1159
- node_offset : i32 ,
1160
1148
/// Index of the union_decl ZIR instruction.
1161
1149
zir_index : Zir.Inst.Index ,
1162
1150
@@ -1203,7 +1191,7 @@ pub const Union = struct {
1203
1191
return .{
1204
1192
.file_scope = owner_decl .getFileScope (),
1205
1193
.parent_decl_node = owner_decl .src_node ,
1206
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
1194
+ .lazy = LazySrcLoc .nodeOffset (0 ),
1207
1195
};
1208
1196
}
1209
1197
@@ -1218,7 +1206,7 @@ pub const Union = struct {
1218
1206
});
1219
1207
return u .srcLoc (mod );
1220
1208
};
1221
- const node = owner_decl .relativeToNodeIndex (u . node_offset );
1209
+ const node = owner_decl .relativeToNodeIndex (0 );
1222
1210
const node_tags = tree .nodes .items (.tag );
1223
1211
var buf : [2 ]Ast.Node.Index = undefined ;
1224
1212
switch (node_tags [node ]) {
@@ -1410,8 +1398,6 @@ pub const Union = struct {
1410
1398
pub const Opaque = struct {
1411
1399
/// The Decl that corresponds to the opaque itself.
1412
1400
owner_decl : Decl.Index ,
1413
- /// Offset from `owner_decl`, points to the opaque decl AST node.
1414
- node_offset : i32 ,
1415
1401
/// Represents the declarations inside this opaque.
1416
1402
namespace : Namespace ,
1417
1403
@@ -1420,7 +1406,7 @@ pub const Opaque = struct {
1420
1406
return .{
1421
1407
.file_scope = owner_decl .getFileScope (),
1422
1408
.parent_decl_node = owner_decl .src_node ,
1423
- .lazy = LazySrcLoc .nodeOffset (self . node_offset ),
1409
+ .lazy = LazySrcLoc .nodeOffset (0 ),
1424
1410
};
1425
1411
}
1426
1412
@@ -4337,7 +4323,6 @@ pub fn semaFile(mod: *Module, file: *File) SemaError!void {
4337
4323
struct_obj .* = .{
4338
4324
.owner_decl = undefined , // set below
4339
4325
.fields = .{},
4340
- .node_offset = 0 , // it's the struct for the root file
4341
4326
.zir_index = undefined , // set below
4342
4327
.layout = .Auto ,
4343
4328
.status = .none ,
0 commit comments