Mark the SCC as "might unwind" if we run into a 'resume' instruction.
authorBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:22:00 +0000 (18:22 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:22:00 +0000 (18:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137627 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/PruneEH.cpp

index b7e63dc4484c63c7a0d12afb709891bda72f9dca..cbb80f07508710a9c2ba24b8f5bb65dcd207d71e 100644 (file)
@@ -101,8 +101,9 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
       // Check to see if this function performs an unwind or calls an
       // unwinding function.
       for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
-        if (CheckUnwind && isa<UnwindInst>(BB->getTerminator())) {
-          // Uses unwind!
+        if (CheckUnwind && (isa<UnwindInst>(BB->getTerminator()) ||
+                            isa<ResumeInst>(BB->getTerminator()))) {
+          // Uses unwind / resume!
           SCCMightUnwind = true;
         } else if (CheckReturn && isa<ReturnInst>(BB->getTerminator())) {
           SCCMightReturn = true;