[llvm-branch-commits] [llvm-branch] r86898 - /llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp

Bill Wendling isanbard at gmail.com
Wed Nov 11 15:18:13 PST 2009


Author: void
Date: Wed Nov 11 17:18:12 2009
New Revision: 86898

URL: http://llvm.org/viewvc/llvm-project?rev=86898&view=rev
Log:
$ svn merge -c 86897 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r86897 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp


Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=86898&r1=86897&r2=86898&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Nov 11 17:18:12 2009
@@ -490,7 +490,27 @@
     for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end();
          MI != E; ++MI) {
       if (!MI->isLabel()) {
-        SawPotentiallyThrowing |= MI->getDesc().isCall();
+        if (MI->getDesc().isCall()) {
+          // Don't mark a call as potentially throwing if the function it's
+          // calling is marked "nounwind".
+          bool DoesNotThrow = false;
+          for (unsigned OI = 0, OE = MI->getNumOperands(); OI != OE; ++OI) {
+            const MachineOperand &MO = MI->getOperand(OI);
+
+            if (MO.isGlobal()) {
+              if (Function *F = dyn_cast<Function>(MO.getGlobal())) {
+                if (F->doesNotThrow()) {
+                  DoesNotThrow = true;
+                  break;
+                }
+              }
+            }
+          }
+
+          if (!DoesNotThrow)
+            SawPotentiallyThrowing = true;
+        }
+
         continue;
       }
 





More information about the llvm-branch-commits mailing list