zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit df5577c28bf1cc26f8bcf21ed1201e31987ac009 (tree)
parent ba60d456b45bd391ec25195c800d61ab14de7985
Author: Robin Voetter <robin@voetter.nl>
Date:   Fri, 25 Nov 2022 23:58:21 +0100

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.

Diffstat:
Msrc/codegen/spirv.zig | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig @@ -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", .{});