[cfe-commits] r109463 - in /cfe/trunk: lib/CodeGen/CodeGenFunction.cpp test/CodeGenCXX/eh.cpp

John McCall rjmccall at apple.com
Mon Jul 26 15:44:58 PDT 2010


Author: rjmccall
Date: Mon Jul 26 17:44:58 2010
New Revision: 109463

URL: http://llvm.org/viewvc/llvm-project?rev=109463&view=rev
Log:
Test for the presence of EH branch-throughs instead of normal branch-throughs.
I knew this code duplication would bite me.


Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/test/CodeGenCXX/eh.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=109463&r1=109462&r2=109463&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Jul 26 17:44:58 2010
@@ -830,7 +830,7 @@
 
     // If we have exactly one branch-after and no branch-throughs, we
     // can dispatch it without a switch.
-    if (!Scope.hasBranchThroughs() &&
+    if (!Scope.hasEHBranchThroughs() &&
         Scope.getNumEHBranchAfters() == 1) {
       assert(!EHBranchThroughDest);
 

Modified: cfe/trunk/test/CodeGenCXX/eh.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/eh.cpp?rev=109463&r1=109462&r2=109463&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/eh.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/eh.cpp Mon Jul 26 17:44:58 2010
@@ -361,3 +361,21 @@
     } catch (int x) {}
   }
 }
+
+// rdar://problem/8231514
+namespace test14 {
+  struct A { ~A(); };
+  struct B { ~B(); };
+
+  B b();
+  void opaque();
+
+  void foo() {
+    A a;
+    try {
+      B str = b();
+      opaque();
+    } catch (int x) {
+    }
+  }
+}





More information about the cfe-commits mailing list