9#ifndef LLVM_TABLEGEN_STRINGTOOFFSETTABLE_H
10#define LLVM_TABLEGEN_STRINGTOOFFSETTABLE_H
26 std::string AggregateString;
33 StringOffset.
insert(std::make_pair(Str, AggregateString.size()));
34 if (IterBool.second) {
36 AggregateString.append(Str.begin(), Str.end());
38 AggregateString +=
'\0';
41 return IterBool.first->second;
48 AggregateString = std::string(Str.str());
51 unsigned CharsPrinted = 0;
52 for (
unsigned i = 0, e = AggregateString.size(); i != e; ++i) {
53 if (CharsPrinted > 70) {
57 O << AggregateString[i];
61 if (AggregateString[i] !=
'\\')
64 assert(i + 1 < AggregateString.size() &&
"Incomplete escape sequence!");
65 if (isdigit(AggregateString[i + 1])) {
66 assert(isdigit(AggregateString[i + 2]) &&
67 isdigit(AggregateString[i + 3]) &&
68 "Expected 3 digit octal escape!");
69 O << AggregateString[++i];
70 O << AggregateString[++i];
71 O << AggregateString[++i];
74 O << AggregateString[++i];
84 assert(AggregateString.find(
')') == std::string::npos &&
85 "can't emit raw string with closing parens");
88 for (
char C : AggregateString) {
This file defines the StringMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
StringToOffsetTable - This class uniques a bunch of nul-terminated strings and keeps track of their o...
void EmitCharArray(raw_ostream &O)
Emit the string using character literals.
unsigned GetOrAddStringOffset(StringRef Str, bool appendZero=true)
void EmitString(raw_ostream &O)
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.