aboutsummaryrefslogtreecommitdiff
path: root/lib/std/special
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-12-23 21:52:06 +0100
committerLemonBoy <thatlemon@gmail.com>2020-01-02 18:53:16 +0100
commit563d9ebfe597b313b265a5a30296c081fe35d87a (patch)
tree9b67e280b607498d1592fbc420d10ec39d835440 /lib/std/special
parent7bd80f207147167821634e16983edf9e9b115c9f (diff)
downloadzig-563d9ebfe597b313b265a5a30296c081fe35d87a.tar.gz
zig-563d9ebfe597b313b265a5a30296c081fe35d87a.zip
Implement the callconv() annotation
Diffstat (limited to 'lib/std/special')
-rw-r--r--lib/std/special/c.zig2
-rw-r--r--lib/std/special/compiler_rt.zig10
-rw-r--r--lib/std/special/compiler_rt/arm/aeabi_dcmp.zig10
-rw-r--r--lib/std/special/compiler_rt/arm/aeabi_fcmp.zig10
-rw-r--r--lib/std/special/compiler_rt/aulldiv.zig4
-rw-r--r--lib/std/special/compiler_rt/aullrem.zig4
-rw-r--r--lib/std/special/compiler_rt/stack_probe.zig12
7 files changed, 26 insertions, 26 deletions
diff --git a/lib/std/special/c.zig b/lib/std/special/c.zig
index 0895b1e6f9..c0ee9a938e 100644
--- a/lib/std/special/c.zig
+++ b/lib/std/special/c.zig
@@ -195,7 +195,7 @@ extern fn __stack_chk_fail() noreturn {
// TODO we should be able to put this directly in std/linux/x86_64.zig but
// it causes a segfault in release mode. this is a workaround of calling it
// across .o file boundaries. fix comptime @ptrCast of nakedcc functions.
-nakedcc fn clone() void {
+fn clone() callconv(.Naked) void {
switch (builtin.arch) {
.i386 => {
// __clone(func, stack, flags, arg, ptid, tls, ctid)
diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig
index 0426f72417..f821918ccc 100644
--- a/lib/std/special/compiler_rt.zig
+++ b/lib/std/special/compiler_rt.zig
@@ -528,7 +528,7 @@ fn usesThumb1PreArmv6(arch: builtin.Arch) bool {
};
}
-nakedcc fn __aeabi_memcpy() noreturn {
+fn __aeabi_memcpy() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
if (use_thumb_1) {
asm volatile (
@@ -544,7 +544,7 @@ nakedcc fn __aeabi_memcpy() noreturn {
unreachable;
}
-nakedcc fn __aeabi_memmove() noreturn {
+fn __aeabi_memmove() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
if (use_thumb_1) {
asm volatile (
@@ -560,7 +560,7 @@ nakedcc fn __aeabi_memmove() noreturn {
unreachable;
}
-nakedcc fn __aeabi_memset() noreturn {
+fn __aeabi_memset() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
if (use_thumb_1_pre_armv6) {
asm volatile (
@@ -591,7 +591,7 @@ nakedcc fn __aeabi_memset() noreturn {
unreachable;
}
-nakedcc fn __aeabi_memclr() noreturn {
+fn __aeabi_memclr() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
if (use_thumb_1_pre_armv6) {
asm volatile (
@@ -619,7 +619,7 @@ nakedcc fn __aeabi_memclr() noreturn {
unreachable;
}
-nakedcc fn __aeabi_memcmp() noreturn {
+fn __aeabi_memcmp() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
if (use_thumb_1) {
asm volatile (
diff --git a/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig b/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig
index 7463c49931..d75c343fbb 100644
--- a/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig
+++ b/lib/std/special/compiler_rt/arm/aeabi_dcmp.zig
@@ -12,31 +12,31 @@ const ConditionalOperator = enum {
Gt,
};
-pub nakedcc fn __aeabi_dcmpeq() noreturn {
+pub fn __aeabi_dcmpeq() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_dcmp, .{.Eq});
unreachable;
}
-pub nakedcc fn __aeabi_dcmplt() noreturn {
+pub fn __aeabi_dcmplt() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_dcmp, .{.Lt});
unreachable;
}
-pub nakedcc fn __aeabi_dcmple() noreturn {
+pub fn __aeabi_dcmple() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_dcmp, .{.Le});
unreachable;
}
-pub nakedcc fn __aeabi_dcmpge() noreturn {
+pub fn __aeabi_dcmpge() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_dcmp, .{.Ge});
unreachable;
}
-pub nakedcc fn __aeabi_dcmpgt() noreturn {
+pub fn __aeabi_dcmpgt() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_dcmp, .{.Gt});
unreachable;
diff --git a/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig b/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig
index 9a24641d9a..bf36e78ad2 100644
--- a/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig
+++ b/lib/std/special/compiler_rt/arm/aeabi_fcmp.zig
@@ -12,31 +12,31 @@ const ConditionalOperator = enum {
Gt,
};
-pub nakedcc fn __aeabi_fcmpeq() noreturn {
+pub fn __aeabi_fcmpeq() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_fcmp, .{.Eq});
unreachable;
}
-pub nakedcc fn __aeabi_fcmplt() noreturn {
+pub fn __aeabi_fcmplt() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_fcmp, .{.Lt});
unreachable;
}
-pub nakedcc fn __aeabi_fcmple() noreturn {
+pub fn __aeabi_fcmple() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_fcmp, .{.Le});
unreachable;
}
-pub nakedcc fn __aeabi_fcmpge() noreturn {
+pub fn __aeabi_fcmpge() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_fcmp, .{.Ge});
unreachable;
}
-pub nakedcc fn __aeabi_fcmpgt() noreturn {
+pub fn __aeabi_fcmpgt() callconv(.Naked) noreturn {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, aeabi_fcmp, .{.Gt});
unreachable;
diff --git a/lib/std/special/compiler_rt/aulldiv.zig b/lib/std/special/compiler_rt/aulldiv.zig
index dfca4f4c43..afc96492c1 100644
--- a/lib/std/special/compiler_rt/aulldiv.zig
+++ b/lib/std/special/compiler_rt/aulldiv.zig
@@ -1,6 +1,6 @@
const builtin = @import("builtin");
-pub extern stdcallcc fn _alldiv(a: i64, b: i64) i64 {
+pub extern fn _alldiv(a: i64, b: i64) callconv(.Stdcall) i64 {
@setRuntimeSafety(builtin.is_test);
const s_a = a >> (i64.bit_count - 1);
const s_b = b >> (i64.bit_count - 1);
@@ -13,7 +13,7 @@ pub extern stdcallcc fn _alldiv(a: i64, b: i64) i64 {
return (@bitCast(i64, r) ^ s) -% s;
}
-pub nakedcc fn _aulldiv() void {
+pub fn _aulldiv() callconv(.Naked) void {
@setRuntimeSafety(false);
// The stack layout is:
diff --git a/lib/std/special/compiler_rt/aullrem.zig b/lib/std/special/compiler_rt/aullrem.zig
index c1fee72032..748aaa0f89 100644
--- a/lib/std/special/compiler_rt/aullrem.zig
+++ b/lib/std/special/compiler_rt/aullrem.zig
@@ -1,6 +1,6 @@
const builtin = @import("builtin");
-pub extern stdcallcc fn _allrem(a: i64, b: i64) i64 {
+pub extern fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 {
@setRuntimeSafety(builtin.is_test);
const s_a = a >> (i64.bit_count - 1);
const s_b = b >> (i64.bit_count - 1);
@@ -13,7 +13,7 @@ pub extern stdcallcc fn _allrem(a: i64, b: i64) i64 {
return (@bitCast(i64, r) ^ s) -% s;
}
-pub nakedcc fn _aullrem() void {
+pub fn _aullrem() callconv(.Naked) void {
@setRuntimeSafety(false);
// The stack layout is:
diff --git a/lib/std/special/compiler_rt/stack_probe.zig b/lib/std/special/compiler_rt/stack_probe.zig
index 6406f3977a..dd441b2f32 100644
--- a/lib/std/special/compiler_rt/stack_probe.zig
+++ b/lib/std/special/compiler_rt/stack_probe.zig
@@ -1,7 +1,7 @@
const builtin = @import("builtin");
// Zig's own stack-probe routine (available only on x86 and x86_64)
-pub nakedcc fn zig_probe_stack() void {
+pub fn zig_probe_stack() callconv(.Naked) void {
@setRuntimeSafety(false);
// Versions of the Linux kernel before 5.1 treat any access below SP as
@@ -180,11 +180,11 @@ fn win_probe_stack_adjust_sp() void {
// ___chkstk (__alloca) | yes | yes |
// ___chkstk_ms | no | no |
-pub nakedcc fn _chkstk() void {
+pub fn _chkstk() callconv(.Naked) void {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{});
}
-pub nakedcc fn __chkstk() void {
+pub fn __chkstk() callconv(.Naked) void {
@setRuntimeSafety(false);
switch (builtin.arch) {
.i386 => @call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{}),
@@ -192,15 +192,15 @@ pub nakedcc fn __chkstk() void {
else => unreachable,
}
}
-pub nakedcc fn ___chkstk() void {
+pub fn ___chkstk() callconv(.Naked) void {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, win_probe_stack_adjust_sp, .{});
}
-pub nakedcc fn __chkstk_ms() void {
+pub fn __chkstk_ms() callconv(.Naked) void {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
}
-pub nakedcc fn ___chkstk_ms() void {
+pub fn ___chkstk_ms() callconv(.Naked) void {
@setRuntimeSafety(false);
@call(.{ .modifier = .always_inline }, win_probe_stack_only, .{});
}