spirv: allow more calling conventions

This allows the Zig calling convention and makes way for a Kernel
calling convention in the future. Any future checks on calling
conventions should be placed in Sema.zig.
This commit is contained in:
Robin Voetter
2022-11-25 23:58:21 +01:00
parent ba60d456b4
commit df5577c28b

View File

@@ -491,9 +491,7 @@ pub const DeclGen = struct {
break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));
},
.Fn => blk: {
// We only support C-calling-convention functions for now, no varargs.
if (ty.fnCallingConvention() != .C)
return self.fail("Unsupported calling convention for SPIR-V", .{});
// TODO: Put this somewhere in Sema.zig
if (ty.fnIsVarArgs())
return self.fail("VarArgs functions are unsupported for SPIR-V", .{});