[PATCH] D126136: [TableGen] emitStringLiteralDef: Pad trailing '\0' at the end of char array.

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 21 17:18:06 PDT 2022


chapuni created this revision.
Herald added a project: All.
chapuni requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixup for https://reviews.llvm.org/D73044
String literal has an implicit terminator '\0'. This commit adjusts char array
to long literal.

This causes difference of artifacts between -long-string-literals=true
and false.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126136

Files:
  llvm/utils/TableGen/SequenceToOffsetTable.h


Index: llvm/utils/TableGen/SequenceToOffsetTable.h
===================================================================
--- llvm/utils/TableGen/SequenceToOffsetTable.h
+++ llvm/utils/TableGen/SequenceToOffsetTable.h
@@ -179,7 +179,7 @@
     } else {
       OS << Decl << " = {\n";
       emit(OS, printChar, "0");
-      OS << "\n};\n\n";
+      OS << "  0\n};\n\n";
       return;
     }
     for (auto I : Seqs) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126136.431188.patch
Type: text/x-patch
Size: 415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220522/0c3cd864/attachment.bin>


More information about the llvm-commits mailing list