llvm.org GIT mirror llvm / 5edfbeb
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136354 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 9 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
250250 #define NUM_GRAPHS (NUM_NODES * (NUM_NODES - 1))
251251
252252 /// GraphDescriptor - Enumerate all graphs using NUM_GRAPHS bits.
253 uint16_t GraphDescriptor = 0;
254 assert(NUM_GRAPHS <= sizeof(uint16_t) * CHAR_BIT && "Too many graphs!");
253 unsigned GraphDescriptor = 0;
254 assert(NUM_GRAPHS <= sizeof(unsigned) * CHAR_BIT && "Too many graphs!");
255255
256256 do {
257257 typedef Graph GT;
259259 GT G;
260260
261261 // Add edges as specified by the descriptor.
262 uint16_t DescriptorCopy = GraphDescriptor;
262 unsigned DescriptorCopy = GraphDescriptor;
263263 for (unsigned i = 0; i != NUM_NODES; ++i)
264264 for (unsigned j = 0; j != NUM_NODES; ++j) {
265265 // Always add a self-edge.
343343 EXPECT_EQ(NodesInSomeSCC, G.NodesReachableFrom(0));
344344
345345 ++GraphDescriptor;
346 } while (GraphDescriptor && (unsigned)GraphDescriptor < (1U << NUM_GRAPHS));
346 } while (GraphDescriptor && GraphDescriptor < (1U << NUM_GRAPHS));
347347 }
348348
349349 }