sgefa uses truely huge data structures nodes. Only print part of them if they
authorChris Lattner <sabre@nondot.org>
Thu, 3 Oct 2002 21:55:13 +0000 (21:55 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 3 Oct 2002 21:55:13 +0000 (21:55 +0000)
are so big

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

lib/Analysis/DataStructure/Printer.cpp

index b78861c13470dc13a994079870ad531033649642..51ebe632eb43bedacc5a536b2055a8acb2186c87 100644 (file)
@@ -103,17 +103,22 @@ void DSNode::print(std::ostream &O, const DSGraph *G) const {
 
   O << "\tNode" << (void*)this << " [ label =\"{" << Caption;
 
+  unsigned Size = getSize();
+  if (Size > 64) Size = 64;   // Don't print out HUGE graph nodes!
+
   if (getSize() != 0) {
     O << "|{";
-    for (unsigned i = 0; i < getSize(); ++i) {
+    for (unsigned i = 0; i < Size; ++i) {
       if (i) O << "|";
       O << "<g" << i << ">" << (int)MergeMap[i];
     }
+    if (Size != getSize())
+      O << "|truncated...";
     O << "}";
   }
   O << "}\"];\n";
 
-  for (unsigned i = 0; i != getSize(); ++i)
+  for (unsigned i = 0; i != Size; ++i)
     if (const DSNodeHandle *DSN = getLink(i))
       writeEdge(O, this, ":g", i, *DSN);
 }