Make sure that landing pad entries in the EH call site table are in the proper
[oota-llvm.git] / lib / CodeGen / SjLjEHPrepare.cpp
index 95589331cf423d1c567b29fb3633b7ab42518b96..95b94e6c307376a267d422a4c2318845701c8ecc 100644 (file)
@@ -474,8 +474,10 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
     // 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.