[llvm-commits] [llvm] r99695 - /llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp

Bill Wendling isanbard at gmail.com
Fri Mar 26 18:22:38 PDT 2010


Author: void
Date: Fri Mar 26 20:22:38 2010
New Revision: 99695

URL: http://llvm.org/viewvc/llvm-project?rev=99695&view=rev
Log:
Return if we changed anything or not.

Modified:
    llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp

Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=99695&r1=99694&r2=99695&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Fri Mar 26 20:22:38 2010
@@ -86,7 +86,7 @@
     /// CleanupSelectors - Any remaining eh.selector intrinsic calls which still
     /// use the ".llvm.eh.catch.all.value" call need to convert to using it's
     /// initializer instead.
-    void CleanupSelectors();
+    bool CleanupSelectors();
 
     /// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow"
     /// calls. The "unwind" part of these invokes jump to a landing pad within
@@ -220,7 +220,8 @@
 /// CleanupSelectors - Any remaining eh.selector intrinsic calls which still use
 /// the ".llvm.eh.catch.all.value" call need to convert to using it's
 /// initializer instead.
-void DwarfEHPrepare::CleanupSelectors() {
+bool DwarfEHPrepare::CleanupSelectors() {
+  bool Changed = false;
   for (Value::use_iterator
          I = SelectorIntrinsic->use_begin(),
          E = SelectorIntrinsic->use_end(); I != E; ++I) {
@@ -232,7 +233,10 @@
     GlobalVariable *GV = dyn_cast<GlobalVariable>(Sel->getOperand(OpIdx));
     if (GV != EHCatchAllValue) continue;
     Sel->setOperand(OpIdx, EHCatchAllValue->getInitializer());
+    Changed = true;
   }
+
+  return Changed;
 }
 
 /// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" calls. The
@@ -254,19 +258,13 @@
 
   if (!URoR) {
     URoR = F->getParent()->getFunction("_Unwind_Resume_or_Rethrow");
-    if (!URoR) {
-      CleanupSelectors();
-      return false;
-    }
+    if (!URoR) return CleanupSelectors();
   }
 
   if (!ExceptionValueIntrinsic) {
     ExceptionValueIntrinsic =
       Intrinsic::getDeclaration(F->getParent(), Intrinsic::eh_exception);
-    if (!ExceptionValueIntrinsic) {
-      CleanupSelectors();
-      return false;
-    }
+    if (!ExceptionValueIntrinsic) return CleanupSelectors();
   }
 
   bool Changed = false;
@@ -337,7 +335,7 @@
     }
   }
 
-  CleanupSelectors();
+  Changed |= CleanupSelectors();
   return Changed;
 }
 





More information about the llvm-commits mailing list