@@ -1733,20 +1733,22 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
1733
1733
BuildMI (MBB, MI, DL, TII.get (AArch64::SEH_Nop))
1734
1734
.setMIFlag (MachineInstr::FrameSetup);
1735
1735
1736
- // Emit a CFI instruction that causes 8 to be subtracted from the value of
1737
- // x18 when unwinding past this frame.
1738
- static const char CFIInst[] = {
1739
- dwarf::DW_CFA_val_expression,
1740
- 18 , // register
1741
- 2 , // length
1742
- static_cast <char >(unsigned (dwarf::DW_OP_breg18)),
1743
- static_cast <char >(-8 ) & 0x7f , // addend (sleb128)
1744
- };
1745
- unsigned CFIIndex =
1746
- MF.addFrameInst (MCCFIInstruction::createEscape (nullptr , CFIInst));
1747
- BuildMI (MBB, MI, DL, TII.get (AArch64::CFI_INSTRUCTION))
1748
- .addCFIIndex (CFIIndex)
1749
- .setMIFlag (MachineInstr::FrameSetup);
1736
+ if (!MF.getFunction ().hasFnAttribute (Attribute::NoUnwind)) {
1737
+ // Emit a CFI instruction that causes 8 to be subtracted from the value of
1738
+ // x18 when unwinding past this frame.
1739
+ static const char CFIInst[] = {
1740
+ dwarf::DW_CFA_val_expression,
1741
+ 18 , // register
1742
+ 2 , // length
1743
+ static_cast <char >(unsigned (dwarf::DW_OP_breg18)),
1744
+ static_cast <char >(-8 ) & 0x7f , // addend (sleb128)
1745
+ };
1746
+ unsigned CFIIndex =
1747
+ MF.addFrameInst (MCCFIInstruction::createEscape (nullptr , CFIInst));
1748
+ BuildMI (MBB, MI, DL, TII.get (AArch64::CFI_INSTRUCTION))
1749
+ .addCFIIndex (CFIIndex)
1750
+ .setMIFlag (MachineInstr::FrameSetup);
1751
+ }
1750
1752
1751
1753
// This instruction also makes x18 live-in to the entry block.
1752
1754
MBB.addLiveIn (AArch64::X18);
0 commit comments