Skip to content

Commit d5f09f5

Browse files
committed
x86_64: fix windows calling convention abi
1 parent bc4da9a commit d5f09f5

File tree

4 files changed

+5749
-9972
lines changed

4 files changed

+5749
-9972
lines changed

src/codegen/llvm.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12103,7 +12103,7 @@ fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: *const st
1210312103
return switch (fn_info.cc) {
1210412104
.auto => returnTypeByRef(zcu, target, return_type),
1210512105
.x86_64_sysv => firstParamSRetSystemV(return_type, zcu, target),
12106-
.x86_64_win => x86_64_abi.classifyWindows(return_type, zcu, target) == .memory,
12106+
.x86_64_win => x86_64_abi.classifyWindows(return_type, zcu, target, .ret) == .memory,
1210712107
.x86_sysv, .x86_win => isByRef(return_type, zcu),
1210812108
.x86_stdcall => !isScalar(zcu, return_type),
1210912109
.wasm_mvp => wasm_c_abi.classifyType(return_type, zcu) == .indirect,
@@ -12205,7 +12205,7 @@ fn lowerFnRetTy(o: *Object, pt: Zcu.PerThread, fn_info: InternPool.Key.FuncType)
1220512205
fn lowerWin64FnRetTy(o: *Object, pt: Zcu.PerThread, fn_info: InternPool.Key.FuncType) Allocator.Error!Builder.Type {
1220612206
const zcu = pt.zcu;
1220712207
const return_type = Type.fromInterned(fn_info.return_type);
12208-
switch (x86_64_abi.classifyWindows(return_type, zcu, zcu.getTarget())) {
12208+
switch (x86_64_abi.classifyWindows(return_type, zcu, zcu.getTarget(), .ret)) {
1220912209
.integer => {
1221012210
if (isScalar(zcu, return_type)) {
1221112211
return o.lowerType(pt, return_type);
@@ -12476,7 +12476,7 @@ const ParamTypeIterator = struct {
1247612476

1247712477
fn nextWin64(it: *ParamTypeIterator, ty: Type) ?Lowering {
1247812478
const zcu = it.pt.zcu;
12479-
switch (x86_64_abi.classifyWindows(ty, zcu, zcu.getTarget())) {
12479+
switch (x86_64_abi.classifyWindows(ty, zcu, zcu.getTarget(), .arg)) {
1248012480
.integer => {
1248112481
if (isScalar(zcu, ty)) {
1248212482
it.zig_index += 1;

0 commit comments

Comments
 (0)