Allow printing partially constructed bitsets
authorChris Lattner <sabre@nondot.org>
Fri, 6 Dec 2002 04:42:10 +0000 (04:42 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Dec 2002 04:42:10 +0000 (04:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4941 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/Record.cpp
utils/TableGen/Record.cpp

index b33e5e774b7e9a113d85c07b0aa89446b3d73536..469faa9b01bf4d290d1255d3b1869f7973900644 100644 (file)
@@ -153,7 +153,10 @@ void BitsInit::print(std::ostream &OS) const {
   OS << "{ ";
   for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
     if (i) OS << ", ";
-    getBit(e-i-1)->print(OS);
+    if (Init *Bit = getBit(e-i-1))
+      Bit->print(OS);
+    else
+      OS << "*";
   }
   OS << " }";
 }
index b33e5e774b7e9a113d85c07b0aa89446b3d73536..469faa9b01bf4d290d1255d3b1869f7973900644 100644 (file)
@@ -153,7 +153,10 @@ void BitsInit::print(std::ostream &OS) const {
   OS << "{ ";
   for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
     if (i) OS << ", ";
-    getBit(e-i-1)->print(OS);
+    if (Init *Bit = getBit(e-i-1))
+      Bit->print(OS);
+    else
+      OS << "*";
   }
   OS << " }";
 }