Add the sentinal "no handle" value to the ResumeInst.
authorBill Wendling <isanbard@gmail.com>
Wed, 24 Aug 2011 00:00:23 +0000 (00:00 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 24 Aug 2011 00:00:23 +0000 (00:00 +0000)
A value of -1 at a call site tells the personality function that this call isn't
handled by the current function. Since the ResumeInsts are converted to calls to
_Unwind_SjLj_Resume, add a (volatile) store of -1 to its 'call site'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138416 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SjLjEHPrepare.cpp

index be491b13834e77edb816fde49004bfb95a1bf41a..ebed3d2b882de9c9eadc6e338aa1e6cc2c8c65c8 100644 (file)
@@ -631,6 +631,8 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
         if (Callee != SelectorFn && Callee != ExceptionFn
             && !CI->doesNotThrow())
           insertCallSiteStore(CI, -1, CallSite);
+      } else if (ResumeInst *RI = dyn_cast<ResumeInst>(I)) {
+        insertCallSiteStore(RI, -1, CallSite);
       }
   }