[cfe-commits] r110704 - in /cfe/trunk: lib/CodeGen/CGDeclCXX.cpp test/CodeGenCXX/threadsafe-statics-exceptions.cpp

John McCall rjmccall at apple.com
Tue Aug 10 11:51:44 PDT 2010


Author: rjmccall
Date: Tue Aug 10 13:51:44 2010
New Revision: 110704

URL: http://llvm.org/viewvc/llvm-project?rev=110704&view=rev
Log:
When initializing a static local, pop the guard-abort EH cleanup after
the variable is fully initialized.


Modified:
    cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
    cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp

Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=110704&r1=110703&r2=110704&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Tue Aug 10 13:51:44 2010
@@ -398,6 +398,10 @@
     EmitDeclInit(*this, D, GV);
 
   if (ThreadsafeStatics) {
+    // Pop the guard-abort cleanup if we pushed one.
+    if (Exceptions)
+      PopCleanupBlock();
+
     // Call __cxa_guard_release.  This cannot throw.
     Builder.CreateCall(getGuardReleaseFn(*this), GuardVariable);    
   } else {

Modified: cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp?rev=110704&r1=110703&r2=110704&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp Tue Aug 10 13:51:44 2010
@@ -17,7 +17,7 @@
   static X x;
 
   // CHECK: call i8* @__cxa_allocate_exception
-  // CHECK: invoke void @__cxa_throw
+  // CHECK: call void @__cxa_throw
   throw Y();
 
   // Finally, the landing pad.





More information about the cfe-commits mailing list