You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (cc_resolved == .Interrupt) switch (target.cpu.arch) {
9719
-
.x86, .x86_64 => {
9717
+
switch (cc_resolved) {
9718
+
.Interrupt => if (target.cpu.arch.isX86()) {
9720
9719
const err_code_size = target.ptrBitWidth();
9721
9720
switch (i) {
9722
-
0 => if (param_ty.zigTypeTag(mod) != .Pointer) return sema.fail(block, param_src, "parameter must be a pointer type", .{}),
9723
-
1 => if (param_ty.bitSize(mod) != err_code_size) return sema.fail(block, param_src, "parameter must be a {d}-bit integer", .{err_code_size}),
9724
-
else => return sema.fail(block, param_src, "Interrupt calling convention supports up to 2 parameters, found {d}", .{i + 1}),
9721
+
0 => if (param_ty.zigTypeTag(mod) != .Pointer) return sema.fail(block, param_src, "first parameter of function with 'Interrupt' calling convention must be a pointer type", .{}),
9722
+
1 => if (param_ty.bitSize(mod) != err_code_size) return sema.fail(block, param_src, "second parameter of function with 'Interrupt' calling convention must be a {d}-bit integer", .{err_code_size}),
9723
+
else => return sema.fail(block, param_src, "'Interrupt' calling convention supports up to 2 parameters, found {d}", .{i + 1}),
9725
9724
}
9726
-
},
9727
-
else => return sema.fail(block, param_src, "parameters are not allowed with Interrupt calling convention", .{}),
9728
-
};
9725
+
} else return sema.fail(block, param_src, "parameters are not allowed with 'Interrupt' calling convention", .{}),
9726
+
.Signal => return sema.fail(block, param_src, "parameters are not allowed with 'Signal' calling convention", .{}),
9727
+
else => {},
9728
+
}
9729
9729
}
9730
9730
9731
9731
var ret_ty_requires_comptime = false;
@@ -10031,6 +10031,16 @@ fn finishFunc(
10031
10031
return sema.failWithOwnedErrorMsg(block, msg);
10032
10032
}
10033
10033
10034
+
switch (cc_resolved) {
10035
+
.Interrupt, .Signal => if (return_type.zigTypeTag(mod) != .Void and return_type.zigTypeTag(mod) != .NoReturn) {
10036
+
return sema.fail(block, ret_ty_src, "function with calling convention '{s}' must return 'void' or 'noreturn'", .{@tagName(cc_resolved)});
10037
+
},
10038
+
.Inline => if (is_noinline) {
10039
+
return sema.fail(block, cc_src, "'noinline' function cannot have callconv 'Inline'", .{});
const msg = try sema.errMsg(block, src, "pointer to comptime-only type '{}' must be comptime-known, but operand is runtime-known", .{ptr_ty.fmt(mod)});
0 commit comments