Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
Fix the mono calling convention on arm64+linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz authored and lewurm committed Nov 8, 2018
1 parent acb33f3 commit 37e14bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/Target/AArch64/AArch64CallingConvention.td
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,12 @@ def CC_AArch64_Mono_DarwinPCS : CallingConv<[

CCDelegateTo<CC_AArch64_DarwinPCS>
]>;

def CC_AArch64_Mono_AAPCS : CallingConv<[

// Mono marks the parameter it wants to pass in this non-abi register with
// the 'inreg' attribute.
CCIfInReg<CCAssignToReg<[X15]>>,

CCDelegateTo<CC_AArch64_AAPCS>
]>;
7 changes: 6 additions & 1 deletion lib/Target/AArch64/AArch64ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,12 @@ CCAssignFn *AArch64TargetLowering::CCAssignFnForCall(CallingConv::ID CC,
return CC_AArch64_AAPCS;
return IsVarArg ? CC_AArch64_DarwinPCS_VarArg : CC_AArch64_DarwinPCS;
case CallingConv::Mono:
return CC_AArch64_Mono_DarwinPCS;
if (Subtarget->isTargetDarwin())
return CC_AArch64_Mono_DarwinPCS;
else if (Subtarget->isTargetWindows())
report_fatal_error("Unsupported calling convention.");
else
return CC_AArch64_Mono_AAPCS;
}
}

Expand Down

0 comments on commit 37e14bd

Please sign in to comment.