diff options
Diffstat (limited to 'include/llvm/TableGen/StringToOffsetTable.h')
-rw-r--r-- | include/llvm/TableGen/StringToOffsetTable.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/TableGen/StringToOffsetTable.h b/include/llvm/TableGen/StringToOffsetTable.h index e3277036dc76..e5b61ed1195e 100644 --- a/include/llvm/TableGen/StringToOffsetTable.h +++ b/include/llvm/TableGen/StringToOffsetTable.h @@ -76,6 +76,26 @@ public: } O << "\""; } + + /// Emit the string using character literals. MSVC has a limitation that + /// string literals cannot be longer than 64K. + void EmitCharArray(raw_ostream &O) { + assert(AggregateString.find(')') == std::string::npos && + "can't emit raw string with closing parens"); + int Count = 0; + O << ' '; + for (char C : AggregateString) { + O << " \'"; + O.write_escaped(StringRef(&C, 1)); + O << "\',"; + Count++; + if (Count > 14) { + O << "\n "; + Count = 0; + } + } + O << '\n'; + } }; } // end namespace llvm |