[llvm] [TableGen] Allow empty terminator in SequenceToOffsetTable (PR #119751)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 13:18:30 PST 2024


================
@@ -127,10 +135,10 @@ class SequenceToOffsetTable {
   /// `\0`. Falls back to emitting a comma-separated integer list if
   /// `EmitLongStrLiterals` is false
   void emitStringLiteralDef(raw_ostream &OS, const Twine &Decl) const {
-    assert(Entries && "Call layout() before emitStringLiteralDef()");
+    assert(IsLaidOut && "Call layout() before emitStringLiteralDef()");
     if (!EmitLongStrLiterals) {
       OS << Decl << " = {\n";
-      emit(OS, printChar, "0");
+      emit(OS, printChar);
----------------
s-barannikov wrote:

It is printed by `emit` after each subsequence, assuming the terminator was provided.
The line below adds an extra '0' that I believe it should not do (and I think I ran into this before), but this is a pre-existing behavior and may be related to the issue I'm observing (see my comment below).

https://github.com/llvm/llvm-project/pull/119751


More information about the llvm-commits mailing list