forked from OSchip/llvm-project
Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the LLVM side it means that sret functions don't pop the stack. llvm-svn: 197163
This commit is contained in:
parent
80d333ba22
commit
32cb5ac904
|
@ -1863,7 +1863,7 @@ static unsigned computeBytesPoppedByCallee(const X86Subtarget &Subtarget,
|
|||
const ImmutableCallSite &CS) {
|
||||
if (Subtarget.is64Bit())
|
||||
return 0;
|
||||
if (Subtarget.isTargetWindows())
|
||||
if (Subtarget.getTargetTriple().isOSMSVCRT())
|
||||
return 0;
|
||||
CallingConv::ID CC = CS.getCallingConv();
|
||||
if (CC == CallingConv::Fast || CC == CallingConv::GHC)
|
||||
|
|
|
@ -2175,7 +2175,6 @@ X86TargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
bool Is64Bit = Subtarget->is64Bit();
|
||||
bool IsWindows = Subtarget->isTargetWindows();
|
||||
bool IsWin64 = Subtarget->isCallingConvWin64(CallConv);
|
||||
|
||||
assert(!(isVarArg && IsTailCallConvention(CallConv)) &&
|
||||
|
@ -2420,7 +2419,8 @@ X86TargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
} else {
|
||||
FuncInfo->setBytesToPopOnReturn(0); // Callee pops nothing.
|
||||
// If this is an sret function, the return should pop the hidden pointer.
|
||||
if (!Is64Bit && !IsTailCallConvention(CallConv) && !IsWindows &&
|
||||
if (!Is64Bit && !IsTailCallConvention(CallConv) &&
|
||||
!Subtarget->getTargetTriple().isOSMSVCRT() &&
|
||||
argsAreStructReturn(Ins) == StackStructReturn)
|
||||
FuncInfo->setBytesToPopOnReturn(4);
|
||||
}
|
||||
|
@ -2509,7 +2509,6 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
bool Is64Bit = Subtarget->is64Bit();
|
||||
bool IsWin64 = Subtarget->isCallingConvWin64(CallConv);
|
||||
bool IsWindows = Subtarget->isTargetWindows();
|
||||
StructReturnType SR = callIsStructReturn(Outs);
|
||||
bool IsSibcall = false;
|
||||
|
||||
|
@ -2903,7 +2902,8 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
if (X86::isCalleePop(CallConv, Is64Bit, isVarArg,
|
||||
getTargetMachine().Options.GuaranteedTailCallOpt))
|
||||
NumBytesForCalleeToPush = NumBytes; // Callee pops everything
|
||||
else if (!Is64Bit && !IsTailCallConvention(CallConv) && !IsWindows &&
|
||||
else if (!Is64Bit && !IsTailCallConvention(CallConv) &&
|
||||
!Subtarget->getTargetTriple().isOSMSVCRT() &&
|
||||
SR == StackStructReturn)
|
||||
// If this is a call to a struct-return function, the callee
|
||||
// pops the hidden struct pointer, so we have to push it back.
|
||||
|
|
|
@ -19,7 +19,7 @@ entry:
|
|||
; WIN32: {{ret$}}
|
||||
|
||||
; MINGW_X86-LABEL: _sret1:
|
||||
; MINGW_X86: ret $4
|
||||
; MINGW_X86: {{ret$}}
|
||||
|
||||
; LINUX-LABEL: sret1:
|
||||
; LINUX: ret $4
|
||||
|
@ -36,7 +36,7 @@ entry:
|
|||
; WIN32: {{ret$}}
|
||||
|
||||
; MINGW_X86-LABEL: _sret2:
|
||||
; MINGW_X86: ret $4
|
||||
; MINGW_X86: {{ret$}}
|
||||
|
||||
; LINUX-LABEL: sret2:
|
||||
; LINUX: ret $4
|
||||
|
@ -54,7 +54,7 @@ entry:
|
|||
; WIN32: {{ret$}}
|
||||
|
||||
; MINGW_X86-LABEL: _sret3:
|
||||
; MINGW_X86: ret $4
|
||||
; MINGW_X86: {{ret$}}
|
||||
|
||||
; LINUX-LABEL: sret3:
|
||||
; LINUX: ret $4
|
||||
|
@ -75,7 +75,7 @@ entry:
|
|||
; WIN32: {{ret$}}
|
||||
|
||||
; MINGW_X86-LABEL: _sret4:
|
||||
; MINGW_X86: ret $4
|
||||
; MINGW_X86: {{ret$}}
|
||||
|
||||
; LINUX-LABEL: sret4:
|
||||
; LINUX: ret $4
|
||||
|
|
Loading…
Reference in New Issue