11#include "llvm/Config/llvm-config.h"
19 if (LHSKind == StdStringKind && RHSKind == EmptyKind)
20 return *LHS.stdString;
24 if (LHSKind == FormatvObjectKind && RHSKind == EmptyKind)
25 return LHS.formatvObject->str();
39 switch (getLHSKind()) {
44 const std::string *
str = LHS.stdString;
58 NodeKind Kind)
const {
60 case Twine::NullKind:
break;
61 case Twine::EmptyKind:
break;
62 case Twine::TwineKind:
65 case Twine::CStringKind:
68 case Twine::StdStringKind:
71 case Twine::PtrAndLengthKind:
74 case Twine::FormatvObjectKind:
75 OS << *
Ptr.formatvObject;
80 case Twine::DecUIKind:
86 case Twine::DecULKind:
92 case Twine::DecULLKind:
95 case Twine::DecLLKind:
107 case Twine::NullKind:
109 case Twine::EmptyKind:
110 OS <<
"empty";
break;
111 case Twine::TwineKind:
113 Ptr.twine->printRepr(
OS);
115 case Twine::CStringKind:
117 <<
Ptr.cString <<
"\"";
119 case Twine::StdStringKind:
120 OS <<
"std::string:\""
121 <<
Ptr.stdString <<
"\"";
123 case Twine::PtrAndLengthKind:
124 OS <<
"ptrAndLength:\""
127 case Twine::FormatvObjectKind:
128 OS <<
"formatv:\"" << *
Ptr.formatvObject <<
"\"";
130 case Twine::CharKind:
131 OS <<
"char:\"" <<
Ptr.character <<
"\"";
133 case Twine::DecUIKind:
134 OS <<
"decUI:\"" <<
Ptr.decUI <<
"\"";
136 case Twine::DecIKind:
137 OS <<
"decI:\"" <<
Ptr.decI <<
"\"";
139 case Twine::DecULKind:
140 OS <<
"decUL:\"" << *
Ptr.decUL <<
"\"";
142 case Twine::DecLKind:
143 OS <<
"decL:\"" << *
Ptr.decL <<
"\"";
145 case Twine::DecULLKind:
146 OS <<
"decULL:\"" << *
Ptr.decULL <<
"\"";
148 case Twine::DecLLKind:
149 OS <<
"decLL:\"" << *
Ptr.decLL <<
"\"";
151 case Twine::UHexKind:
152 OS <<
"uhex:\"" <<
Ptr.uHex <<
"\"";
158 printOneChild(
OS, LHS, getLHSKind());
159 printOneChild(
OS, RHS, getRHSKind());
164 printOneChildRepr(
OS, LHS, getLHSKind());
166 printOneChildRepr(
OS, RHS, getRHSKind());
170#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the SmallString class.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
pointer data()
Return a pointer to the vector's buffer, even if empty().
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
std::string str() const
Return the twine contents as a std::string.
void print(raw_ostream &OS) const
Write the concatenated string represented by this twine to the stream OS.
StringRef toNullTerminatedStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single null terminated StringRef if it can be represented as such.
void dump() const
Dump the concatenated string represented by this twine to stderr.
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.
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
void dumpRepr() const
Dump the representation of this twine to stderr.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
A raw_ostream that writes to an SmallVector or SmallString.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Determine the kind of a node from its type.