Reapply 153764 and 153761 with a fix.
[oota-llvm.git] / utils / TableGen / SequenceToOffsetTable.h
index 26e705841f2b64256c6a5cca0da6682dfebdcf46..09dccbb1084affb3da75847eecdde3c8d9086de2 100644 (file)
@@ -103,7 +103,9 @@ public:
 
   /// emit - Print out the table as the body of an array initializer.
   /// Use the Print function to print elements.
-  void emit(raw_ostream &OS, void (*Print)(raw_ostream&, ElemT)) const {
+  void emit(raw_ostream &OS,
+            void (*Print)(raw_ostream&, ElemT),
+            const char *Term = "0") const {
     assert(Entries && "Call layout() before emit()");
     for (typename SeqMap::const_iterator I = Seqs.begin(), E = Seqs.end();
          I != E; ++I) {
@@ -113,7 +115,7 @@ public:
         Print(OS, *SI);
         OS << ", ";
       }
-      OS << "0,\n";
+      OS << Term << ",\n";
     }
   }
 };