std::reverse(ObjectsToAllocate.begin(), ObjectsToAllocate.end());
}
-
-unsigned X86FrameLowering::getWinEHParentFrameOffset(const MachineFunction &MF) const {
+unsigned
+X86FrameLowering::getWinEHParentFrameOffset(const MachineFunction &MF) const {
+ const X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
// RDX, the parent frame pointer, is homed into 16(%rsp) in the prologue.
unsigned Offset = 16;
// RBP is immediately pushed.
Offset += SlotSize;
// All callee-saved registers are then pushed.
- Offset += MF.getInfo<X86MachineFunctionInfo>()->getCalleeSavedFrameSize();
+ Offset += X86FI->getCalleeSavedFrameSize();
+ // Funclets allocate space for however XMM registers are required.
+ int Ignore;
+ if (MF.getTarget().getMCAsmInfo()->usesWindowsCFI())
+ Offset += X86FI->getCalleeSavedXMMFrameInfo(Ignore);
// Every funclet allocates enough stack space for the largest outgoing call.
Offset += getWinEHFuncletFrameSize(MF);
return Offset;
; CHECK: popq %rbx
; CHECK: popq %rbp
; CHECK: retq # CATCHRET
+
+; CHECK-LABEL: "$handlerMap$0$?foo@@YAXXZ":
+; CHECK-NEXT: .long 0 # Adjectives
+; CHECK-NEXT: .long "??_R0H@8"@IMGREL # Type
+; CHECK-NEXT: .long 44 # CatchObjOffset
+; CHECK-NEXT: .long "?catch${{.*}}??foo@@YAXXZ@4HA"@IMGREL # Handler
+; Sum of:
+; 16 RDX store offset
+; 16 two pushes
+; 72 stack alloc
+; CHECK-NEXT: .long 104 # ParentFrameOffset