mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Move calling convention conversion into TargetABI.
The code is tightly coupled to TargetABI (the transformations there only make sense knowing that the right CC is selected).
This commit is contained in:
@@ -26,6 +26,26 @@ struct X86TargetABI : TargetABI
|
||||
CfloatToInt cfloatToInt;
|
||||
CompositeToInt compositeToInt;
|
||||
|
||||
llvm::CallingConv::ID callingConv(LINK l)
|
||||
{
|
||||
switch (l)
|
||||
{
|
||||
case LINKc:
|
||||
case LINKcpp:
|
||||
case LINKintrinsic:
|
||||
return llvm::CallingConv::C;
|
||||
case LINKd:
|
||||
case LINKdefault:
|
||||
return global.params.targetTriple.isOSWindows() ?
|
||||
llvm::CallingConv::C : llvm::CallingConv::X86_StdCall;
|
||||
case LINKpascal:
|
||||
case LINKwindows:
|
||||
return llvm::CallingConv::X86_StdCall;
|
||||
default:
|
||||
llvm_unreachable("Unhandled D linkage type.");
|
||||
}
|
||||
}
|
||||
|
||||
bool returnInArg(TypeFunction* tf)
|
||||
{
|
||||
#if DMDV2
|
||||
|
||||
Reference in New Issue
Block a user