[llvm-commits] [llvm] r109872 - /llvm/trunk/lib/Support/CrashRecoveryContext.cpp

Daniel Dunbar daniel at zuster.org
Fri Jul 30 10:49:05 PDT 2010


Author: ddunbar
Date: Fri Jul 30 12:49:04 2010
New Revision: 109872

URL: http://llvm.org/viewvc/llvm-project?rev=109872&view=rev
Log:
Fix -Wmissing-field-initializers warnings.

Modified:
    llvm/trunk/lib/Support/CrashRecoveryContext.cpp

Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=109872&r1=109871&r2=109872&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original)
+++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Fri Jul 30 12:49:04 2010
@@ -87,18 +87,9 @@
 
 #include <signal.h>
 
-static struct {
-  int Signal;
-  struct sigaction PrevAction;
-} SignalInfo[] = {
-  { SIGABRT, {} },
-  { SIGBUS,  {} },
-  { SIGFPE,  {} },
-  { SIGILL,  {} },
-  { SIGSEGV, {} },
-  { SIGTRAP, {} },
-};
-static const unsigned NumSignals = sizeof(SignalInfo) / sizeof(SignalInfo[0]);
+static int Signals[] = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP };
+static const unsigned NumSignals = sizeof(Signals) / sizeof(Signals[0]);
+static struct sigaction PrevActions[NumSignals];
 
 static void CrashRecoverySignalHandler(int Signal) {
   // Lookup the current thread local recovery object.
@@ -142,8 +133,7 @@
   sigemptyset(&Handler.sa_mask);
 
   for (unsigned i = 0; i != NumSignals; ++i) {
-    sigaction(SignalInfo[i].Signal, &Handler,
-              &SignalInfo[i].PrevAction);
+    sigaction(Signals[i], &Handler, &PrevActions[i]);
   }
 }
 
@@ -155,7 +145,7 @@
 
   // Restore the previous signal handlers.
   for (unsigned i = 0; i != NumSignals; ++i)
-    sigaction(SignalInfo[i].Signal, &SignalInfo[i].PrevAction, 0);
+    sigaction(Signals[i], &PrevActions[i], 0);
 }
 
 #endif





More information about the llvm-commits mailing list