[PATCH] D126135: emitStringLiteralDef: Return earlier here. NFC.
NAKAMURA Takumi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 21 17:15:18 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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126135
Files:
llvm/utils/TableGen/SequenceToOffsetTable.h
Index: llvm/utils/TableGen/SequenceToOffsetTable.h
===================================================================
--- llvm/utils/TableGen/SequenceToOffsetTable.h
+++ llvm/utils/TableGen/SequenceToOffsetTable.h
@@ -170,18 +170,18 @@
/// `EmitLongStrLiterals` is false
void emitStringLiteralDef(raw_ostream &OS, const llvm::Twine &Decl) const {
assert(Entries && "Call layout() before emitStringLiteralDef()");
- if (EmitLongStrLiterals) {
- OS << "\n#ifdef __GNUC__\n"
- << "#pragma GCC diagnostic push\n"
- << "#pragma GCC diagnostic ignored \"-Woverlength-strings\"\n"
- << "#endif\n"
- << Decl << " = {\n";
- } else {
+ if (!EmitLongStrLiterals) {
OS << Decl << " = {\n";
emit(OS, printChar, "0");
OS << "\n};\n\n";
return;
}
+
+ OS << "\n#ifdef __GNUC__\n"
+ << "#pragma GCC diagnostic push\n"
+ << "#pragma GCC diagnostic ignored \"-Woverlength-strings\"\n"
+ << "#endif\n"
+ << Decl << " = {\n";
for (auto I : Seqs) {
OS << " /* " << I.second << " */ \"";
for (auto C : I.first) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126135.431187.patch
Type: text/x-patch
Size: 1128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220522/0da6f9bb/attachment.bin>
More information about the llvm-commits
mailing list