[llvm-commits] [llvm] r136354 - /llvm/trunk/unittests/ADT/SCCIteratorTest.cpp

Duncan Sands baldrick at free.fr
Thu Jul 28 07:37:53 PDT 2011


Author: baldrick
Date: Thu Jul 28 09:37:53 2011
New Revision: 136354

URL: http://llvm.org/viewvc/llvm-project?rev=136354&view=rev
Log:
Use unsigned rather than uint16_t in case anyone feels like testing
more graphs, like all graphs with 5 nodes or less.  With a 32 bit
unsigned type, the maximum is graphs with 6 nodes or less, but that
would take a while to test - 5 nodes or less already requires a few
seconds.

Modified:
    llvm/trunk/unittests/ADT/SCCIteratorTest.cpp

Modified: llvm/trunk/unittests/ADT/SCCIteratorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/SCCIteratorTest.cpp?rev=136354&r1=136353&r2=136354&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/SCCIteratorTest.cpp (original)
+++ llvm/trunk/unittests/ADT/SCCIteratorTest.cpp Thu Jul 28 09:37:53 2011
@@ -251,8 +251,8 @@
 #define NUM_GRAPHS (NUM_NODES * (NUM_NODES - 1))
 
   /// GraphDescriptor - Enumerate all graphs using NUM_GRAPHS bits.
-  uint16_t GraphDescriptor = 0;
-  assert(NUM_GRAPHS <= sizeof(uint16_t) * CHAR_BIT && "Too many graphs!");
+  unsigned GraphDescriptor = 0;
+  assert(NUM_GRAPHS <= sizeof(unsigned) * CHAR_BIT && "Too many graphs!");
 
   do {
     typedef Graph<NUM_NODES> GT;
@@ -260,7 +260,7 @@
     GT G;
 
     // Add edges as specified by the descriptor.
-    uint16_t DescriptorCopy = GraphDescriptor;
+    unsigned DescriptorCopy = GraphDescriptor;
     for (unsigned i = 0; i != NUM_NODES; ++i)
       for (unsigned j = 0; j != NUM_NODES; ++j) {
         // Always add a self-edge.
@@ -344,7 +344,7 @@
     EXPECT_EQ(NodesInSomeSCC, G.NodesReachableFrom(0));
 
     ++GraphDescriptor;
-  } while (GraphDescriptor && (unsigned)GraphDescriptor < (1U << NUM_GRAPHS));
+  } while (GraphDescriptor && GraphDescriptor < (1U << NUM_GRAPHS));
 }
 
 }





More information about the llvm-commits mailing list