Skip to content

Commit 08b2d49

Browse files
committed
update usages of @call
1 parent 7b2a936 commit 08b2d49

21 files changed

Lines changed: 103 additions & 109 deletions

lib/compiler_rt/stack_probe.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,27 +236,27 @@ fn win_probe_stack_adjust_sp() void {
236236

237237
pub fn _chkstk() callconv(.Naked) void {
238238
@setRuntimeSafety(false);
239-
@call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{});
239+
@call(.always_inline, win_probe_stack_adjust_sp, .{});
240240
}
241241
pub fn __chkstk() callconv(.Naked) void {
242242
@setRuntimeSafety(false);
243243
if (comptime arch.isAARCH64()) {
244-
@call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
244+
@call(.always_inline, win_probe_stack_only, .{});
245245
} else switch (arch) {
246-
.x86 => @call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{}),
247-
.x86_64 => @call(.{ .modifier = .always_inline }, win_probe_stack_only, .{}),
246+
.x86 => @call(.always_inline, win_probe_stack_adjust_sp, .{}),
247+
.x86_64 => @call(.always_inline, win_probe_stack_only, .{}),
248248
else => unreachable,
249249
}
250250
}
251251
pub fn ___chkstk() callconv(.Naked) void {
252252
@setRuntimeSafety(false);
253-
@call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{});
253+
@call(.always_inline, win_probe_stack_adjust_sp, .{});
254254
}
255255
pub fn __chkstk_ms() callconv(.Naked) void {
256256
@setRuntimeSafety(false);
257-
@call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
257+
@call(.always_inline, win_probe_stack_only, .{});
258258
}
259259
pub fn ___chkstk_ms() callconv(.Naked) void {
260260
@setRuntimeSafety(false);
261-
@call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
261+
@call(.always_inline, win_probe_stack_only, .{});
262262
}

lib/std/Thread.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,18 +387,18 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) {
387387

388388
switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) {
389389
.NoReturn => {
390-
@call(.{}, f, args);
390+
@call(.auto, f, args);
391391
},
392392
.Void => {
393-
@call(.{}, f, args);
393+
@call(.auto, f, args);
394394
return default_value;
395395
},
396396
.Int => |info| {
397397
if (info.bits != 8) {
398398
@compileError(bad_fn_ret);
399399
}
400400

401-
const status = @call(.{}, f, args);
401+
const status = @call(.auto, f, args);
402402
if (Impl != PosixThreadImpl) {
403403
return status;
404404
}
@@ -411,7 +411,7 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) {
411411
@compileError(bad_fn_ret);
412412
}
413413

414-
@call(.{}, f, args) catch |err| {
414+
@call(.auto, f, args) catch |err| {
415415
std.debug.print("error: {s}\n", .{@errorName(err)});
416416
if (@errorReturnTrace()) |trace| {
417417
std.debug.dumpStackTrace(trace.*);

lib/std/crypto/siphash.zig

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round
7878
pub fn update(self: *Self, b: []const u8) void {
7979
std.debug.assert(b.len % 8 == 0);
8080

81-
const inl = std.builtin.CallOptions{ .modifier = .always_inline };
82-
8381
var off: usize = 0;
8482
while (off < b.len) : (off += 8) {
8583
const blob = b[off..][0..8].*;
86-
@call(inl, round, .{ self, blob });
84+
@call(.always_inline, round, .{ self, blob });
8785
}
8886

8987
self.msg_len +%= @truncate(u8, b.len);
@@ -105,12 +103,9 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round
105103
self.v2 ^= 0xff;
106104
}
107105

108-
// TODO this is a workaround, should be able to supply the value without a separate variable
109-
const inl = std.builtin.CallOptions{ .modifier = .always_inline };
110-
111106
comptime var i: usize = 0;
112107
inline while (i < d_rounds) : (i += 1) {
113-
@call(inl, sipRound, .{self});
108+
@call(.always_inline, sipRound, .{self});
114109
}
115110

116111
const b1 = self.v0 ^ self.v1 ^ self.v2 ^ self.v3;
@@ -122,7 +117,7 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round
122117

123118
comptime var j: usize = 0;
124119
inline while (j < d_rounds) : (j += 1) {
125-
@call(inl, sipRound, .{self});
120+
@call(.always_inline, sipRound, .{self});
126121
}
127122

128123
const b2 = self.v0 ^ self.v1 ^ self.v2 ^ self.v3;
@@ -133,11 +128,9 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round
133128
const m = mem.readIntLittle(u64, b[0..8]);
134129
self.v3 ^= m;
135130

136-
// TODO this is a workaround, should be able to supply the value without a separate variable
137-
const inl = std.builtin.CallOptions{ .modifier = .always_inline };
138131
comptime var i: usize = 0;
139132
inline while (i < c_rounds) : (i += 1) {
140-
@call(inl, sipRound, .{self});
133+
@call(.always_inline, sipRound, .{self});
141134
}
142135

143136
self.v0 ^= m;
@@ -163,8 +156,8 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round
163156
pub fn hash(msg: []const u8, key: *const [key_length]u8) T {
164157
const aligned_len = msg.len - (msg.len % 8);
165158
var c = Self.init(key);
166-
@call(.{ .modifier = .always_inline }, c.update, .{msg[0..aligned_len]});
167-
return @call(.{ .modifier = .always_inline }, c.final, .{msg[aligned_len..]});
159+
@call(.always_inline, c.update, .{msg[0..aligned_len]});
160+
return @call(.always_inline, c.final, .{msg[aligned_len..]});
168161
}
169162
};
170163
}

lib/std/dynamic_library.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pub const DlDynlib = struct {
381381
pub fn lookup(self: *DlDynlib, comptime T: type, name: [:0]const u8) ?T {
382382
// dlsym (and other dl-functions) secretly take shadow parameter - return address on stack
383383
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826
384-
if (@call(.{ .modifier = .never_tail }, system.dlsym, .{ self.handle, name.ptr })) |symbol| {
384+
if (@call(.never_tail, system.dlsym, .{ self.handle, name.ptr })) |symbol| {
385385
return @ptrCast(T, symbol);
386386
} else {
387387
return null;

lib/std/hash/auto_hash.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
6666
const Key = @TypeOf(key);
6767

6868
if (strat == .Shallow and comptime meta.trait.hasUniqueRepresentation(Key)) {
69-
@call(.{ .modifier = .always_inline }, hasher.update, .{mem.asBytes(&key)});
69+
@call(.always_inline, hasher.update, .{mem.asBytes(&key)});
7070
return;
7171
}
7272

@@ -89,12 +89,12 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
8989
// TODO Check if the situation is better after #561 is resolved.
9090
.Int => {
9191
if (comptime meta.trait.hasUniqueRepresentation(Key)) {
92-
@call(.{ .modifier = .always_inline }, hasher.update, .{std.mem.asBytes(&key)});
92+
@call(.always_inline, hasher.update, .{std.mem.asBytes(&key)});
9393
} else {
9494
// Take only the part containing the key value, the remaining
9595
// bytes are undefined and must not be hashed!
9696
const byte_size = comptime std.math.divCeil(comptime_int, @bitSizeOf(Key), 8) catch unreachable;
97-
@call(.{ .modifier = .always_inline }, hasher.update, .{std.mem.asBytes(&key)[0..byte_size]});
97+
@call(.always_inline, hasher.update, .{std.mem.asBytes(&key)[0..byte_size]});
9898
}
9999
},
100100

@@ -103,7 +103,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
103103
.ErrorSet => hash(hasher, @errorToInt(key), strat),
104104
.AnyFrame, .Fn => hash(hasher, @ptrToInt(key), strat),
105105

106-
.Pointer => @call(.{ .modifier = .always_inline }, hashPointer, .{ hasher, key, strat }),
106+
.Pointer => @call(.always_inline, hashPointer, .{ hasher, key, strat }),
107107

108108
.Optional => if (key) |k| hash(hasher, k, strat),
109109

lib/std/hash/cityhash.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub const CityHash64 = struct {
185185
}
186186

187187
fn hashLen16(u: u64, v: u64) u64 {
188-
return @call(.{ .modifier = .always_inline }, hash128To64, .{ u, v });
188+
return @call(.always_inline, hash128To64, .{ u, v });
189189
}
190190

191191
fn hashLen16Mul(low: u64, high: u64, mul: u64) u64 {
@@ -198,7 +198,7 @@ pub const CityHash64 = struct {
198198
}
199199

200200
fn hash128To64(low: u64, high: u64) u64 {
201-
return @call(.{ .modifier = .always_inline }, hashLen16Mul, .{ low, high, 0x9ddfea08eb382d69 });
201+
return @call(.always_inline, hashLen16Mul, .{ low, high, 0x9ddfea08eb382d69 });
202202
}
203203

204204
fn hashLen0To16(str: []const u8) u64 {
@@ -279,7 +279,7 @@ pub const CityHash64 = struct {
279279
}
280280

281281
fn weakHashLen32WithSeeds(ptr: [*]const u8, a: u64, b: u64) WeakPair {
282-
return @call(.{ .modifier = .always_inline }, weakHashLen32WithSeedsHelper, .{
282+
return @call(.always_inline, weakHashLen32WithSeedsHelper, .{
283283
fetch64(ptr, 0),
284284
fetch64(ptr, 8),
285285
fetch64(ptr, 16),
@@ -334,7 +334,7 @@ pub const CityHash64 = struct {
334334
}
335335

336336
pub fn hashWithSeed(str: []const u8, seed: u64) u64 {
337-
return @call(.{ .modifier = .always_inline }, Self.hashWithSeeds, .{ str, k2, seed });
337+
return @call(.always_inline, Self.hashWithSeeds, .{ str, k2, seed });
338338
}
339339

340340
pub fn hashWithSeeds(str: []const u8, seed0: u64, seed1: u64) u64 {

lib/std/hash/murmur.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub const Murmur2_32 = struct {
99
const Self = @This();
1010

1111
pub fn hash(str: []const u8) u32 {
12-
return @call(.{ .modifier = .always_inline }, Self.hashWithSeed, .{ str, default_seed });
12+
return @call(.always_inline, Self.hashWithSeed, .{ str, default_seed });
1313
}
1414

1515
pub fn hashWithSeed(str: []const u8, seed: u32) u32 {
@@ -45,7 +45,7 @@ pub const Murmur2_32 = struct {
4545
}
4646

4747
pub fn hashUint32(v: u32) u32 {
48-
return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });
48+
return @call(.always_inline, Self.hashUint32WithSeed, .{ v, default_seed });
4949
}
5050

5151
pub fn hashUint32WithSeed(v: u32, seed: u32) u32 {
@@ -65,7 +65,7 @@ pub const Murmur2_32 = struct {
6565
}
6666

6767
pub fn hashUint64(v: u64) u32 {
68-
return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });
68+
return @call(.always_inline, Self.hashUint64WithSeed, .{ v, default_seed });
6969
}
7070

7171
pub fn hashUint64WithSeed(v: u64, seed: u32) u32 {
@@ -94,7 +94,7 @@ pub const Murmur2_64 = struct {
9494
const Self = @This();
9595

9696
pub fn hash(str: []const u8) u64 {
97-
return @call(.{ .modifier = .always_inline }, Self.hashWithSeed, .{ str, default_seed });
97+
return @call(.always_inline, Self.hashWithSeed, .{ str, default_seed });
9898
}
9999

100100
pub fn hashWithSeed(str: []const u8, seed: u64) u64 {
@@ -128,7 +128,7 @@ pub const Murmur2_64 = struct {
128128
}
129129

130130
pub fn hashUint32(v: u32) u64 {
131-
return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });
131+
return @call(.always_inline, Self.hashUint32WithSeed, .{ v, default_seed });
132132
}
133133

134134
pub fn hashUint32WithSeed(v: u32, seed: u64) u64 {
@@ -145,7 +145,7 @@ pub const Murmur2_64 = struct {
145145
}
146146

147147
pub fn hashUint64(v: u64) u64 {
148-
return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });
148+
return @call(.always_inline, Self.hashUint64WithSeed, .{ v, default_seed });
149149
}
150150

151151
pub fn hashUint64WithSeed(v: u64, seed: u64) u64 {
@@ -173,7 +173,7 @@ pub const Murmur3_32 = struct {
173173
}
174174

175175
pub fn hash(str: []const u8) u32 {
176-
return @call(.{ .modifier = .always_inline }, Self.hashWithSeed, .{ str, default_seed });
176+
return @call(.always_inline, Self.hashWithSeed, .{ str, default_seed });
177177
}
178178

179179
pub fn hashWithSeed(str: []const u8, seed: u32) u32 {
@@ -221,7 +221,7 @@ pub const Murmur3_32 = struct {
221221
}
222222

223223
pub fn hashUint32(v: u32) u32 {
224-
return @call(.{ .modifier = .always_inline }, Self.hashUint32WithSeed, .{ v, default_seed });
224+
return @call(.always_inline, Self.hashUint32WithSeed, .{ v, default_seed });
225225
}
226226

227227
pub fn hashUint32WithSeed(v: u32, seed: u32) u32 {
@@ -247,7 +247,7 @@ pub const Murmur3_32 = struct {
247247
}
248248

249249
pub fn hashUint64(v: u64) u32 {
250-
return @call(.{ .modifier = .always_inline }, Self.hashUint64WithSeed, .{ v, default_seed });
250+
return @call(.always_inline, Self.hashUint64WithSeed, .{ v, default_seed });
251251
}
252252

253253
pub fn hashUint64WithSeed(v: u64, seed: u32) u32 {

lib/std/hash/wyhash.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const WyhashStateless = struct {
6565

6666
var off: usize = 0;
6767
while (off < b.len) : (off += 32) {
68-
@call(.{ .modifier = .always_inline }, self.round, .{b[off .. off + 32]});
68+
@call(.always_inline, self.round, .{b[off .. off + 32]});
6969
}
7070

7171
self.msg_len += b.len;
@@ -121,8 +121,8 @@ const WyhashStateless = struct {
121121
const aligned_len = input.len - (input.len % 32);
122122

123123
var c = WyhashStateless.init(seed);
124-
@call(.{ .modifier = .always_inline }, c.update, .{input[0..aligned_len]});
125-
return @call(.{ .modifier = .always_inline }, c.final, .{input[aligned_len..]});
124+
@call(.always_inline, c.update, .{input[0..aligned_len]});
125+
return @call(.always_inline, c.final, .{input[aligned_len..]});
126126
}
127127
};
128128

lib/std/math/big/int.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,7 +3587,7 @@ fn llshl(r: []Limb, a: []const Limb, shift: usize) void {
35873587
const dst_i = src_i + limb_shift;
35883588

35893589
const src_digit = a[src_i];
3590-
r[dst_i] = carry | @call(.{ .modifier = .always_inline }, math.shr, .{
3590+
r[dst_i] = carry | @call(.always_inline, math.shr, .{
35913591
Limb,
35923592
src_digit,
35933593
limb_bits - @intCast(Limb, interior_limb_shift),
@@ -3615,7 +3615,7 @@ fn llshr(r: []Limb, a: []const Limb, shift: usize) void {
36153615

36163616
const src_digit = a[src_i];
36173617
r[dst_i] = carry | (src_digit >> interior_limb_shift);
3618-
carry = @call(.{ .modifier = .always_inline }, math.shl, .{
3618+
carry = @call(.always_inline, math.shl, .{
36193619
Limb,
36203620
src_digit,
36213621
limb_bits - @intCast(Limb, interior_limb_shift),

lib/std/os/linux.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub fn fork() usize {
263263
/// the compiler is not aware of how vfork affects control flow and you may
264264
/// see different results in optimized builds.
265265
pub inline fn vfork() usize {
266-
return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
266+
return @call(.always_inline, syscall0, .{.vfork});
267267
}
268268

269269
pub fn futimens(fd: i32, times: *const [2]timespec) usize {

0 commit comments

Comments
 (0)