Avoid calling array_endof in a static initializer, as it incurs
authorDan Gohman <gohman@apple.com>
Fri, 21 Mar 2008 23:44:21 +0000 (23:44 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 21 Mar 2008 23:44:21 +0000 (23:44 +0000)
dynamic initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48666 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Signals.inc

index ff84639f307993ec41dd632db8a17bd10d1d0c83..f7149b12a363eccf37c79c4b606b9a3253eae0be 100644 (file)
@@ -41,7 +41,7 @@ std::vector<sys::Path> *DirectoriesToRemove = 0;
 const int IntSigs[] = {
   SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
 };
-const int *IntSigsEnd = array_endof(IntSigs);
+const int *IntSigsEnd = IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]);
 
 // KillSigs - Signals that are synchronous with the program that will cause it
 // to die.
@@ -51,7 +51,7 @@ const int KillSigs[] = {
   , SIGEMT
 #endif
 };
-const int *KillSigsEnd = array_endof(KillSigs);
+const int *KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]);
 
 #ifdef HAVE_BACKTRACE
 void* StackTrace[256];