From 5949851074597dbc315476237f42fa67a0b6770a Mon Sep 17 00:00:00 2001 From: kcbanner Date: Thu, 19 Jan 2023 00:37:20 -0500 Subject: llvm: pass non-scalars as byref in .Stdcall - add c_abi tests for .Stdcall - enable (x86|x86_64)-windows-gnu in the c_abi tests --- src/codegen/llvm.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/codegen/llvm.zig') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 8604c7d7f6..178c0aaf0a 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -10798,6 +10798,22 @@ const ParamTypeIterator = struct { }, } }, + .Stdcall => { + it.zig_index += 1; + it.llvm_index += 1; + + if (it.target.cpu.arch != .x86 or it.target.os.tag != .windows) { + return .byval; + } + + const is_scalar = isScalar(ty); + if (is_scalar) { + return .byval; + } else { + it.byval_attr = true; + return .byref; + } + }, else => { it.zig_index += 1; it.llvm_index += 1; -- cgit v1.2.3