Make sure that landing pad entries in the EH call site table are in the proper
order for SjLj style exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94055 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index 9558933..95b94e6 100644
--- a/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/lib/CodeGen/SjLjEHPrepare.cpp
@@ -474,8 +474,10 @@
// At this point, we are all set up, update the invoke instructions
// to mark their call_site values, and fill in the dispatch switch
// accordingly.
- for (unsigned i = 0, e = Invokes.size(); i != e; ++i)
+ for (unsigned i = 0, e = Invokes.size(); i != e; ++i) {
+ F.setCallSiteNumber(Invokes[i], i+1);
markInvokeCallSite(Invokes[i], i+1, CallSite, DispatchSwitch);
+ }
// The front end has likely added calls to _Unwind_Resume. We need
// to find those calls and mark the call_site as -1 immediately prior.