Skip to content

Commit 264acfd

Browse files
committed
stage2: fix incorrect spelling of AtomicOrder
1 parent 97d69e3 commit 264acfd

File tree

8 files changed

+256
-251
lines changed

8 files changed

+256
-251
lines changed

src/AstGen.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7322,7 +7322,7 @@ fn builtinCall(
73227322
},
73237323
} });
73247324
const ptr = try expr(gz, scope, .{ .ty = ptr_type }, params[1]);
7325-
const ordering = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[2]);
7325+
const ordering = try expr(gz, scope, .{ .ty = .atomic_order_type }, params[2]);
73267326
const result = try gz.addPlNode(.atomic_load, node, Zir.Inst.Bin{
73277327
.lhs = ptr,
73287328
.rhs = ordering,
@@ -7343,7 +7343,7 @@ fn builtinCall(
73437343
const ptr = try expr(gz, scope, .{ .ty = ptr_type }, params[1]);
73447344
const operation = try expr(gz, scope, .{ .ty = .atomic_rmw_op_type }, params[2]);
73457345
const operand = try expr(gz, scope, .{ .ty = int_type }, params[3]);
7346-
const ordering = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[4]);
7346+
const ordering = try expr(gz, scope, .{ .ty = .atomic_order_type }, params[4]);
73477347
const result = try gz.addPlNode(.atomic_rmw, node, Zir.Inst.AtomicRmw{
73487348
.ptr = ptr,
73497349
.operation = operation,
@@ -7365,7 +7365,7 @@ fn builtinCall(
73657365
} });
73667366
const ptr = try expr(gz, scope, .{ .ty = ptr_type }, params[1]);
73677367
const operand = try expr(gz, scope, .{ .ty = int_type }, params[2]);
7368-
const ordering = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[3]);
7368+
const ordering = try expr(gz, scope, .{ .ty = .atomic_order_type }, params[3]);
73697369
const result = try gz.addPlNode(.atomic_store, node, Zir.Inst.AtomicStore{
73707370
.ptr = ptr,
73717371
.operand = operand,
@@ -7553,11 +7553,11 @@ fn cmpxchg(
75537553
} });
75547554
const result = try gz.addPlNode(tag, node, Zir.Inst.Cmpxchg{
75557555
// zig fmt: off
7556-
.ptr = try expr(gz, scope, .{ .ty = ptr_type }, params[1]),
7557-
.expected_value = try expr(gz, scope, .{ .ty = int_type }, params[2]),
7558-
.new_value = try expr(gz, scope, .{ .ty = int_type }, params[3]),
7559-
.success_order = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[4]),
7560-
.fail_order = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[5]),
7556+
.ptr = try expr(gz, scope, .{ .ty = ptr_type }, params[1]),
7557+
.expected_value = try expr(gz, scope, .{ .ty = int_type }, params[2]),
7558+
.new_value = try expr(gz, scope, .{ .ty = int_type }, params[3]),
7559+
.success_order = try expr(gz, scope, .{ .ty = .atomic_order_type }, params[4]),
7560+
.fail_order = try expr(gz, scope, .{ .ty = .atomic_order_type }, params[5]),
75617561
// zig fmt: on
75627562
});
75637563
return rvalue(gz, rl, result, node);

src/Sema.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9702,7 +9702,7 @@ fn resolveTypeFields(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, ty: Type
97029702
.type_info => return sema.resolveBuiltinTypeFields(block, src, "TypeInfo"),
97039703
.extern_options => return sema.resolveBuiltinTypeFields(block, src, "ExternOptions"),
97049704
.export_options => return sema.resolveBuiltinTypeFields(block, src, "ExportOptions"),
9705-
.atomic_ordering => return sema.resolveBuiltinTypeFields(block, src, "AtomicOrdering"),
9705+
.atomic_order => return sema.resolveBuiltinTypeFields(block, src, "AtomicOrder"),
97069706
.atomic_rmw_op => return sema.resolveBuiltinTypeFields(block, src, "AtomicRmwOp"),
97079707
.calling_convention => return sema.resolveBuiltinTypeFields(block, src, "CallingConvention"),
97089708
.float_mode => return sema.resolveBuiltinTypeFields(block, src, "FloatMode"),
@@ -10096,7 +10096,7 @@ fn typeHasOnePossibleValue(
1009610096
.var_args_param,
1009710097
.manyptr_u8,
1009810098
.manyptr_const_u8,
10099-
.atomic_ordering,
10099+
.atomic_order,
1010010100
.atomic_rmw_op,
1010110101
.calling_convention,
1010210102
.float_mode,
@@ -10281,7 +10281,7 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref {
1028110281
.@"null" => return .null_type,
1028210282
.@"undefined" => return .undefined_type,
1028310283
.enum_literal => return .enum_literal_type,
10284-
.atomic_ordering => return .atomic_ordering_type,
10284+
.atomic_order => return .atomic_order_type,
1028510285
.atomic_rmw_op => return .atomic_rmw_op_type,
1028610286
.calling_convention => return .calling_convention_type,
1028710287
.float_mode => return .float_mode_type,

src/Zir.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ pub const Inst = struct {
17141714
null_type,
17151715
undefined_type,
17161716
enum_literal_type,
1717-
atomic_ordering_type,
1717+
atomic_order_type,
17181718
atomic_rmw_op_type,
17191719
calling_convention_type,
17201720
float_mode_type,
@@ -1961,9 +1961,9 @@ pub const Inst = struct {
19611961
.ty = Type.initTag(.type),
19621962
.val = Value.initTag(.manyptr_const_u8_type),
19631963
},
1964-
.atomic_ordering_type = .{
1964+
.atomic_order_type = .{
19651965
.ty = Type.initTag(.type),
1966-
.val = Value.initTag(.atomic_ordering_type),
1966+
.val = Value.initTag(.atomic_order_type),
19671967
},
19681968
.atomic_rmw_op_type = .{
19691969
.ty = Type.initTag(.type),

src/type.zig

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub const Type = extern union {
124124
.enum_full,
125125
.enum_nonexhaustive,
126126
.enum_simple,
127-
.atomic_ordering,
127+
.atomic_order,
128128
.atomic_rmw_op,
129129
.calling_convention,
130130
.float_mode,
@@ -743,7 +743,7 @@ pub const Type = extern union {
743743
.empty_struct_literal,
744744
.manyptr_u8,
745745
.manyptr_const_u8,
746-
.atomic_ordering,
746+
.atomic_order,
747747
.atomic_rmw_op,
748748
.calling_convention,
749749
.float_mode,
@@ -955,7 +955,7 @@ pub const Type = extern union {
955955
.single_const_pointer_to_comptime_int => return writer.writeAll("*const comptime_int"),
956956
.manyptr_u8 => return writer.writeAll("[*]u8"),
957957
.manyptr_const_u8 => return writer.writeAll("[*]const u8"),
958-
.atomic_ordering => return writer.writeAll("std.builtin.AtomicOrdering"),
958+
.atomic_order => return writer.writeAll("std.builtin.AtomicOrder"),
959959
.atomic_rmw_op => return writer.writeAll("std.builtin.AtomicRmwOp"),
960960
.calling_convention => return writer.writeAll("std.builtin.CallingConvention"),
961961
.float_mode => return writer.writeAll("std.builtin.FloatMode"),
@@ -1183,7 +1183,7 @@ pub const Type = extern union {
11831183
.@"anyframe",
11841184
.@"null",
11851185
.@"undefined",
1186-
.atomic_ordering,
1186+
.atomic_order,
11871187
.atomic_rmw_op,
11881188
.calling_convention,
11891189
.float_mode,
@@ -1298,7 +1298,7 @@ pub const Type = extern union {
12981298
.enum_literal => return Value.initTag(.enum_literal_type),
12991299
.manyptr_u8 => return Value.initTag(.manyptr_u8_type),
13001300
.manyptr_const_u8 => return Value.initTag(.manyptr_const_u8_type),
1301-
.atomic_ordering => return Value.initTag(.atomic_ordering_type),
1301+
.atomic_order => return Value.initTag(.atomic_order_type),
13021302
.atomic_rmw_op => return Value.initTag(.atomic_rmw_op_type),
13031303
.calling_convention => return Value.initTag(.calling_convention_type),
13041304
.float_mode => return Value.initTag(.float_mode_type),
@@ -1359,7 +1359,7 @@ pub const Type = extern union {
13591359
.error_set_inferred,
13601360
.manyptr_u8,
13611361
.manyptr_const_u8,
1362-
.atomic_ordering,
1362+
.atomic_order,
13631363
.atomic_rmw_op,
13641364
.calling_convention,
13651365
.float_mode,
@@ -1505,7 +1505,7 @@ pub const Type = extern union {
15051505
.bool,
15061506
.array_u8_sentinel_0,
15071507
.array_u8,
1508-
.atomic_ordering,
1508+
.atomic_order,
15091509
.atomic_rmw_op,
15101510
.calling_convention,
15111511
.float_mode,
@@ -1727,7 +1727,7 @@ pub const Type = extern union {
17271727
.u8,
17281728
.i8,
17291729
.bool,
1730-
.atomic_ordering,
1730+
.atomic_order,
17311731
.atomic_rmw_op,
17321732
.calling_convention,
17331733
.float_mode,
@@ -2011,7 +2011,7 @@ pub const Type = extern union {
20112011
@panic("TODO bitSize error union");
20122012
},
20132013

2014-
.atomic_ordering,
2014+
.atomic_order,
20152015
.atomic_rmw_op,
20162016
.calling_convention,
20172017
.float_mode,
@@ -2725,7 +2725,7 @@ pub const Type = extern union {
27252725
.var_args_param,
27262726
.manyptr_u8,
27272727
.manyptr_const_u8,
2728-
.atomic_ordering,
2728+
.atomic_order,
27292729
.atomic_rmw_op,
27302730
.calling_convention,
27312731
.float_mode,
@@ -2903,7 +2903,7 @@ pub const Type = extern union {
29032903
const enum_simple = ty.castTag(.enum_simple).?.data;
29042904
return enum_simple.fields.count();
29052905
},
2906-
.atomic_ordering,
2906+
.atomic_order,
29072907
.atomic_rmw_op,
29082908
.calling_convention,
29092909
.float_mode,
@@ -2927,7 +2927,7 @@ pub const Type = extern union {
29272927
const enum_simple = ty.castTag(.enum_simple).?.data;
29282928
return enum_simple.fields.keys()[field_index];
29292929
},
2930-
.atomic_ordering,
2930+
.atomic_order,
29312931
.atomic_rmw_op,
29322932
.calling_convention,
29332933
.float_mode,
@@ -2950,7 +2950,7 @@ pub const Type = extern union {
29502950
const enum_simple = ty.castTag(.enum_simple).?.data;
29512951
return enum_simple.fields.getIndex(field_name);
29522952
},
2953-
.atomic_ordering,
2953+
.atomic_order,
29542954
.atomic_rmw_op,
29552955
.calling_convention,
29562956
.float_mode,
@@ -3003,7 +3003,7 @@ pub const Type = extern union {
30033003
const tag_ty = Type.initPayload(&buffer.base);
30043004
return S.fieldWithRange(tag_ty, enum_tag, fields_len);
30053005
},
3006-
.atomic_ordering,
3006+
.atomic_order,
30073007
.atomic_rmw_op,
30083008
.calling_convention,
30093009
.float_mode,
@@ -3058,7 +3058,7 @@ pub const Type = extern union {
30583058
const union_obj = ty.cast(Payload.Union).?.data;
30593059
return union_obj.srcLoc();
30603060
},
3061-
.atomic_ordering,
3061+
.atomic_order,
30623062
.atomic_rmw_op,
30633063
.calling_convention,
30643064
.float_mode,
@@ -3095,7 +3095,7 @@ pub const Type = extern union {
30953095
return union_obj.owner_decl;
30963096
},
30973097
.@"opaque" => @panic("TODO"),
3098-
.atomic_ordering,
3098+
.atomic_order,
30993099
.atomic_rmw_op,
31003100
.calling_convention,
31013101
.float_mode,
@@ -3145,7 +3145,7 @@ pub const Type = extern union {
31453145
const tag_ty = Type.initPayload(&buffer.base);
31463146
return S.intInRange(tag_ty, int, fields_len);
31473147
},
3148-
.atomic_ordering,
3148+
.atomic_order,
31493149
.atomic_rmw_op,
31503150
.calling_convention,
31513151
.float_mode,
@@ -3205,7 +3205,7 @@ pub const Type = extern union {
32053205
@"null",
32063206
@"undefined",
32073207
enum_literal,
3208-
atomic_ordering,
3208+
atomic_order,
32093209
atomic_rmw_op,
32103210
calling_convention,
32113211
float_mode,
@@ -3328,7 +3328,7 @@ pub const Type = extern union {
33283328
.empty_struct_literal,
33293329
.manyptr_u8,
33303330
.manyptr_const_u8,
3331-
.atomic_ordering,
3331+
.atomic_order,
33323332
.atomic_rmw_op,
33333333
.calling_convention,
33343334
.float_mode,

src/value.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub const Value = extern union {
6060
null_type,
6161
undefined_type,
6262
enum_literal_type,
63-
atomic_ordering_type,
63+
atomic_order_type,
6464
atomic_rmw_op_type,
6565
calling_convention_type,
6666
float_mode_type,
@@ -223,7 +223,7 @@ pub const Value = extern union {
223223
.abi_align_default,
224224
.manyptr_u8_type,
225225
.manyptr_const_u8_type,
226-
.atomic_ordering_type,
226+
.atomic_order_type,
227227
.atomic_rmw_op_type,
228228
.calling_convention_type,
229229
.float_mode_type,
@@ -409,7 +409,7 @@ pub const Value = extern union {
409409
.abi_align_default,
410410
.manyptr_u8_type,
411411
.manyptr_const_u8_type,
412-
.atomic_ordering_type,
412+
.atomic_order_type,
413413
.atomic_rmw_op_type,
414414
.calling_convention_type,
415415
.float_mode_type,
@@ -622,7 +622,7 @@ pub const Value = extern union {
622622
.enum_literal_type => return out_stream.writeAll("@Type(.EnumLiteral)"),
623623
.manyptr_u8_type => return out_stream.writeAll("[*]u8"),
624624
.manyptr_const_u8_type => return out_stream.writeAll("[*]const u8"),
625-
.atomic_ordering_type => return out_stream.writeAll("std.builtin.AtomicOrdering"),
625+
.atomic_order_type => return out_stream.writeAll("std.builtin.AtomicOrder"),
626626
.atomic_rmw_op_type => return out_stream.writeAll("std.builtin.AtomicRmwOp"),
627627
.calling_convention_type => return out_stream.writeAll("std.builtin.CallingConvention"),
628628
.float_mode_type => return out_stream.writeAll("std.builtin.FloatMode"),
@@ -789,7 +789,7 @@ pub const Value = extern union {
789789
.enum_literal_type => Type.initTag(.enum_literal),
790790
.manyptr_u8_type => Type.initTag(.manyptr_u8),
791791
.manyptr_const_u8_type => Type.initTag(.manyptr_const_u8),
792-
.atomic_ordering_type => Type.initTag(.atomic_ordering),
792+
.atomic_order_type => Type.initTag(.atomic_order),
793793
.atomic_rmw_op_type => Type.initTag(.atomic_rmw_op),
794794
.calling_convention_type => Type.initTag(.calling_convention),
795795
.float_mode_type => Type.initTag(.float_mode),

test/behavior.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ test {
1111
_ = @import("behavior/cast.zig");
1212
_ = @import("behavior/array.zig");
1313
_ = @import("behavior/usingnamespace.zig");
14+
_ = @import("behavior/atomics.zig");
1415

1516
if (!builtin.zig_is_stage2) {
1617
// Tests that only pass for stage1.
@@ -21,7 +22,7 @@ test {
2122
_ = @import("behavior/asm.zig");
2223
_ = @import("behavior/async_fn.zig");
2324
}
24-
_ = @import("behavior/atomics.zig");
25+
_ = @import("behavior/atomics_stage1.zig");
2526
_ = @import("behavior/await_struct.zig");
2627
_ = @import("behavior/bit_shifting.zig");
2728
_ = @import("behavior/bitcast.zig");

0 commit comments

Comments
 (0)