18 if (LHSKind == StdStringKind && RHSKind == EmptyKind)
19 return *LHS.stdString;
33 switch (getLHSKind()) {
38 const std::string *
str = LHS.stdString;
39 return StringRef(str->c_str(), str->size());
51 void Twine::printOneChild(
raw_ostream &OS, Child Ptr,
52 NodeKind
Kind)
const {
54 case Twine::NullKind:
break;
55 case Twine::EmptyKind:
break;
56 case Twine::TwineKind:
59 case Twine::CStringKind:
62 case Twine::StdStringKind:
65 case Twine::StringRefKind:
68 case Twine::SmallStringKind:
69 OS << *Ptr.smallString;
74 case Twine::DecUIKind:
80 case Twine::DecULKind:
86 case Twine::DecULLKind:
89 case Twine::DecLLKind:
98 void Twine::printOneChildRepr(
raw_ostream &OS, Child Ptr,
99 NodeKind Kind)
const {
101 case Twine::NullKind:
103 case Twine::EmptyKind:
104 OS <<
"empty";
break;
105 case Twine::TwineKind:
107 Ptr.twine->printRepr(OS);
109 case Twine::CStringKind:
111 << Ptr.cString <<
"\"";
113 case Twine::StdStringKind:
114 OS <<
"std::string:\""
115 << Ptr.stdString <<
"\"";
117 case Twine::StringRefKind:
119 << Ptr.stringRef <<
"\"";
121 case Twine::SmallStringKind:
122 OS <<
"smallstring:\"" << *Ptr.smallString <<
"\"";
124 case Twine::CharKind:
125 OS <<
"char:\"" << Ptr.character <<
"\"";
127 case Twine::DecUIKind:
128 OS <<
"decUI:\"" << Ptr.decUI <<
"\"";
130 case Twine::DecIKind:
131 OS <<
"decI:\"" << Ptr.decI <<
"\"";
133 case Twine::DecULKind:
134 OS <<
"decUL:\"" << *Ptr.decUL <<
"\"";
136 case Twine::DecLKind:
137 OS <<
"decL:\"" << *Ptr.decL <<
"\"";
139 case Twine::DecULLKind:
140 OS <<
"decULL:\"" << *Ptr.decULL <<
"\"";
142 case Twine::DecLLKind:
143 OS <<
"decLL:\"" << *Ptr.decLL <<
"\"";
145 case Twine::UHexKind:
146 OS <<
"uhex:\"" << Ptr.uHex <<
"\"";
152 printOneChild(OS, LHS, getLHSKind());
153 printOneChild(OS, RHS, getRHSKind());
158 printOneChildRepr(OS, LHS, getLHSKind());
160 printOneChildRepr(OS, RHS, getRHSKind());
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
void push_back(const T &Elt)
std::string str() const
str - Get the contents as an std::string.
A raw_ostream that writes to an SmallVector or SmallString.
void dump() const
Dump the concatenated string represented by this twine to stderr.
void dumpRepr() const
Dump the representation of this twine to stderr.
std::string str() const
Return the twine contents as a std::string.
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
void printRepr(raw_ostream &OS) const
Write the representation of this twine to the stream OS.
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
pointer data()
Return a pointer to the vector's buffer, even if empty().
const ARM::ArchExtKind Kind
StringRef toNullTerminatedStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single null terminated StringRef if it can be represented as such...
void print(raw_ostream &OS) const
Write the concatenated string represented by this twine to the stream OS.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.