summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64
diff options
context:
space:
mode:
authorSanjin Sijaric <ssijaric@codeaurora.org>2019-01-17 00:24:38 +0000
committerSanjin Sijaric <ssijaric@codeaurora.org>2019-01-17 00:24:38 +0000
commit685565ae9a1782a090741a590d83b7cca33d010b (patch)
tree17d6e436db09d484f57b950c4800136747f3eecb /llvm/lib/Target/AArch64
parent82ceec5d01008ab55fb24b4ebc5c24ca9d3caf93 (diff)
downloadbcm5719-llvm-685565ae9a1782a090741a590d83b7cca33d010b.tar.gz
bcm5719-llvm-685565ae9a1782a090741a590d83b7cca33d010b.zip
[SEH] [ARM64] Retrieve the frame pointer from SEH funclets
The Windows ARM64 runtime passes the establisher frame to funclets as the first argument. llvm-svn: 351404
Diffstat (limited to 'llvm/lib/Target/AArch64')
-rw-r--r--llvm/lib/Target/AArch64/AArch64FrameLowering.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
index 621aa8bc783..5719cf34c95 100644
--- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -923,6 +923,17 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF,
if (NeedsWinCFI)
BuildMI(MBB, MBBI, DL, TII->get(AArch64::SEH_PrologEnd))
.setMIFlag(MachineInstr::FrameSetup);
+
+ // SEH funclets are passed the frame pointer in X1. If the parent
+ // function uses the base register, then the base register is used
+ // directly, and is not retrieved from X1.
+ if (F.hasPersonalityFn()) {
+ EHPersonality Per = classifyEHPersonality(F.getPersonalityFn());
+ if (isAsynchronousEHPersonality(Per))
+ BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::COPY), AArch64::FP)
+ .addReg(AArch64::X1).setMIFlag(MachineInstr::FrameSetup);
+ }
+
return;
}
OpenPOWER on IntegriCloud