18 auto [
II, Inserted] = StringOffset.insert({Str,
size()});
21 AggregateString.append(Str.begin(), Str.end());
23 AggregateString +=
'\0';
30 const Twine &Name)
const {
38#pragma GCC diagnostic push
39#pragma GCC diagnostic ignored "-Woverlength-strings"
41{} constexpr char {}{}Storage[] =)",
42 ClassPrefix.empty() ? "static" :
"", ClassPrefix, Name);
50 OS << (UseChars ?
"{\n" :
"\n");
57 assert(Strings.
front().empty() &&
"Expected empty initial string!");
59 "Expected empty string at the end due to terminators!");
77 OS << CharSep <<
"'\\0'";
79 OS << LineSep << (UseChars ?
"};" :
" ;");
83#pragma GCC diagnostic pop
89 Name, ClassPrefix.empty() ? "static constexpr" :
"const",
99 unsigned CharsPrinted = 0;
100 for (
unsigned i = 0, e = EscapedStr.
size(); i != e; ++i) {
101 if (CharsPrinted > 70) {
109 if (EscapedStr[i] !=
'\\')
112 assert(i + 1 < EscapedStr.size() &&
"Incomplete escape sequence!");
113 if (
isDigit(EscapedStr[i + 1])) {
115 "Expected 3 digit octal escape!");
116 O << EscapedStr[++i];
117 O << EscapedStr[++i];
118 O << EscapedStr[++i];
121 O << EscapedStr[++i];
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t IntrinsicInst * II
A helper class to return the specified delimiter string after the first invocation of operator String...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
unsigned GetOrAddStringOffset(StringRef Str)
void EmitStringTableDef(raw_ostream &OS, const Twine &Name) const
void EmitString(raw_ostream &O) const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_escaped(StringRef Str, bool UseHexEscapes=false)
Output Str, turning '\', '\t', ' ', '"', and anything that doesn't satisfy llvm::isPrint into an esca...
A raw_ostream that writes to an SmallVector or SmallString.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
void PrintFatalError(const Twine &Msg)
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
cl::opt< bool > EmitLongStrLiterals
Controls emitting large character arrays as strings or character arrays.
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
iterator_range< SplittingIterator > split(StringRef Str, StringRef Separator)
Split the specified string over a separator and return a range-compatible iterable over its partition...