From 51706af908e0c6acb822ef36760b7fe31faf62a6 Mon Sep 17 00:00:00 2001 From: mlugg Date: Sat, 28 Sep 2024 02:10:25 +0100 Subject: compiler: introduce new `CallingConvention` This commit begins implementing accepted proposal #21209 by making `std.builtin.CallingConvention` a tagged union. The stage1 dance here is a little convoluted. This commit introduces the new type as `NewCallingConvention`, keeping the old `CallingConvention` around. The compiler uses `std.builtin.NewCallingConvention` exclusively, but when fetching the type from `std` when running the compiler (e.g. with `getBuiltinType`), the name `CallingConvention` is used. This allows a prior build of Zig to be used to build this commit. The next commit will update `zig1.wasm`, and then the compiler and standard library can be updated to completely replace `CallingConvention` with `NewCallingConvention`. The second half of #21209 is to remove `@setAlignStack`, which will be implemented in another commit after updating `zig1.wasm`. --- src/codegen/spirv.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/codegen/spirv.zig') diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index ed30ede269..279b7d5056 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -1640,8 +1640,8 @@ const NavGen = struct { comptime assert(zig_call_abi_ver == 3); switch (fn_info.cc) { - .Unspecified, .Kernel, .Fragment, .Vertex, .C => {}, - else => unreachable, // TODO + .auto, .spirv_kernel, .spirv_fragment, .spirv_vertex => {}, + else => @panic("TODO"), } // TODO: Put this somewhere in Sema.zig @@ -2970,7 +2970,7 @@ const NavGen = struct { .id_result_type = return_ty_id, .id_result = result_id, .function_control = switch (fn_info.cc) { - .Inline => .{ .Inline = true }, + .@"inline" => .{ .Inline = true }, else => .{}, }, .function_type = prototype_ty_id, -- cgit v1.2.3