Small syntax cleanup; we don't need to #define constants in C++. No functionality...
authorEli Friedman <eli.friedman@gmail.com>
Thu, 5 May 2011 16:25:23 +0000 (16:25 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 5 May 2011 16:25:23 +0000 (16:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130926 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index fdf3767d8c6529ef00b40e14d45462821da1b538..c6be223e62dfcc81261c44d42edc50a5912267f1 100644 (file)
@@ -225,9 +225,10 @@ static bool FunctionCallsSetJmp(const Function *F) {
     "vfork",
     "getcontext"
   };
-#define NUM_RETURNS_TWICE_FNS sizeof(ReturnsTwiceFns) / sizeof(const char *)
+  static const size_t NumReturnsTwiceFns = sizeof(ReturnsTwiceFns) /
+                                           sizeof(const char *);
 
-  for (unsigned I = 0; I < NUM_RETURNS_TWICE_FNS; ++I)
+  for (unsigned I = 0; I < NumReturnsTwiceFns; ++I)
     if (const Function *Callee = M->getFunction(ReturnsTwiceFns[I])) {
       if (!Callee->use_empty())
         for (Value::const_use_iterator
@@ -239,7 +240,6 @@ static bool FunctionCallsSetJmp(const Function *F) {
     }
 
   return false;
-#undef NUM_RETURNS_TWICE_FNS
 }
 
 /// SplitCriticalSideEffectEdges - Look for critical edges with a PHI value that