- if (MBB.isEHFuncletEntry()) {
- assert(STI.isOSWindows() && "funclets only supported on Windows");
-
- // Set up the FramePtr and BasePtr physical registers using the address
- // passed as EBP or RDX by the MSVC EH runtime.
- if (STI.is32Bit()) {
- // PUSH32r %ebp
- BuildMI(MBB, MBBI, DL, TII.get(X86::PUSH32r))
- .addReg(MachineFramePtr, RegState::Kill)
- .setMIFlag(MachineInstr::FrameSetup);
- // Reset EBP / ESI to something good.
- MBBI = restoreWin32EHStackPointers(MBB, MBBI, DL);
- } else {
- // Immediately spill RDX into the home slot. The runtime cares about this.
- unsigned RDX = Uses64BitFramePtr ? X86::RDX : X86::EDX;
- // MOV64mr %rdx, 16(%rsp)
- unsigned MOVmr = Uses64BitFramePtr ? X86::MOV64mr : X86::MOV32mr;
- addRegOffset(BuildMI(MBB, MBBI, DL, TII.get(MOVmr)),
- StackPtr, true, 16)
+ unsigned RDX = Uses64BitFramePtr ? X86::RDX : X86::EDX;
+ if (IsWin64Prologue && IsFunclet) {
+ // Immediately spill RDX into the home slot. The runtime cares about this.
+ // MOV64mr %rdx, 16(%rsp)
+ unsigned MOVmr = Uses64BitFramePtr ? X86::MOV64mr : X86::MOV32mr;
+ addRegOffset(BuildMI(MBB, MBBI, DL, TII.get(MOVmr)), StackPtr, true, 16)