aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-08-11 00:09:57 +0000
committerJim Grosbach <grosbach@apple.com>2009-08-11 00:09:57 +0000
commit1b747ad8a0694b86e8d98a8b9a05ddfe74ec0cd3 (patch)
tree55ef4dc73ff823568dc8543cbb1b4cfa77191b0b /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent3a1f0f6785e27eb8ede455a3583ca8c885d3911e (diff)
SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish. The front-end generates the register/unregister calls into the SjLj runtime, call-site indices and landing pad dispatch. The back end fills in the LSDA with the call-site information provided by the front end. Catch blocks are not yet implemented. Built on Darwin and verified no llvm-core "make check" regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 0180069623..1d02bffb61 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -4087,7 +4087,11 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
Offset));
return 0;
}
-
+ case Intrinsic::eh_sjlj_callsite: {
+ MachineFunction &MF = DAG.getMachineFunction();
+ MF.setCallSiteIndex(cast<ConstantSDNode>(getValue(I.getOperand(1)))->getZExtValue());
+ return 0;
+ }
case Intrinsic::convertff:
case Intrinsic::convertfsi:
case Intrinsic::convertfui:
@@ -4451,9 +4455,14 @@ void SelectionDAGLowering::LowerCallTo(CallSite CS, SDValue Callee,
}
if (LandingPad && MMI) {
+ MachineFunction &MF = DAG.getMachineFunction();
// Insert a label before the invoke call to mark the try range. This can be
// used to detect deletion of the invoke via the MachineModuleInfo.
BeginLabel = MMI->NextLabelID();
+
+ // Map this landing pad to the current call site entry
+ MF.setLandingPadCallSiteIndex(LandingPad, MF.getCallSiteIndex());
+
// Both PendingLoads and PendingExports must be flushed here;
// this call might not return.
(void)getRoot();