summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2018-11-09 23:33:30 +0000
committerEli Friedman <efriedma@codeaurora.org>2018-11-09 23:33:30 +0000
commitad1151cf6a75f1887623b525184aba03778667f7 (patch)
tree8315cb008001a8d17a783c1acbc92aeba3f5cea1 /llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
parentf30c0117c890fcb8265c556c0a02ab89542473a2 (diff)
downloadbcm5719-llvm-ad1151cf6a75f1887623b525184aba03778667f7.tar.gz
bcm5719-llvm-ad1151cf6a75f1887623b525184aba03778667f7.zip
[ARM64] [Windows] Handle funclets
This patch adds support for funclets in frame lowering and ISel lowering. Together with D50288 and D50166, it enables C++ exception handling. Patch by Sanjin Sijaric, with some fixes by me. Differential Revision: https://reviews.llvm.org/D51524 llvm-svn: 346568
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64MCInstLower.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64MCInstLower.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp b/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
index 6e1824f632e..07295989ec8 100644
--- a/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
@@ -269,4 +269,17 @@ void AArch64MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
if (lowerOperand(MO, MCOp))
OutMI.addOperand(MCOp);
}
+
+ switch (OutMI.getOpcode()) {
+ case AArch64::CATCHRET:
+ OutMI = MCInst();
+ OutMI.setOpcode(AArch64::RET);
+ OutMI.addOperand(MCOperand::createReg(AArch64::LR));
+ break;
+ case AArch64::CLEANUPRET:
+ OutMI = MCInst();
+ OutMI.setOpcode(AArch64::RET);
+ OutMI.addOperand(MCOperand::createReg(AArch64::LR));
+ break;
+ }
}
OpenPOWER on IntegriCloud