Go to the documentation of this file.
17 using namespace msgpack;
23 struct ScalarDocNode :
DocNode {
45 OS << (
Bool ?
"true" :
"false");
52 OS <<
format(
"%#llx", (
unsigned long long)
UInt);
70 if (
Tag ==
"tag:yaml.org,2002:str")
72 if (
Tag ==
"!int" ||
Tag ==
"") {
80 if (Err ==
"" ||
Tag !=
"")
87 if (
Tag ==
"!bool" ||
Tag ==
"") {
90 if (Err ==
"" ||
Tag !=
"")
93 if (
Tag ==
"!float" ||
Tag ==
"") {
96 if (Err ==
"" ||
Tag !=
"")
99 assert((
Tag ==
"!str" ||
Tag ==
"") &&
"unsupported tag");
110 StringRef ScalarDocNode::getYAMLTag()
const {
115 ScalarDocNode
N = getDocument()->getNode();
117 if (
N.getKind() == getKind())
146 template <>
struct PolymorphicTraits<
DocNode> {
149 switch (
N.getKind()) {
151 return NodeKind::Map;
167 return *
static_cast<ScalarDocNode *
>(&
N);
172 template <>
struct TaggedScalarTraits<ScalarDocNode> {
176 TagOS <<
S.getYAMLTag();
182 return S.fromString(Str,
Tag);
186 switch (
S.getKind()) {
188 return ScalarTraits<int64_t>::mustQuote(ScalarStr);
190 return ScalarTraits<uint64_t>::mustQuote(ScalarStr);
192 return ScalarTraits<StringRef>::mustQuote(ScalarStr);
194 return ScalarTraits<bool>::mustQuote(ScalarStr);
196 return ScalarTraits<double>::mustQuote(ScalarStr);
199 return ScalarTraits<std::string>::mustQuote(ScalarStr);
210 ScalarDocNode KeyObj =
M.getDocument()->getNode();
211 KeyObj.fromString(
Key,
"");
212 IO.mapRequired(
Key.str().c_str(),
M.getMap()[KeyObj]);
216 for (
auto I :
M.getMap()) {
217 IO.mapRequired(
I.first.toString().c_str(),
I.second);
237 yaml::Output Yout(OS);
static QuotingType mustQuote(const ScalarDocNode &S, StringRef ScalarStr)
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Document * getDocument() const
static DocNode & element(IO &IO, ArrayDocNode &A, size_t Index)
A raw_ostream that writes to an std::string.
static ArrayDocNode & getAsSequence(DocNode &N)
static void clear(coro::Shape &Shape)
A node in a MsgPack Document.
This class implements an extremely fast bulk output stream that can only output to a stream.
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 input
bool fromYAML(StringRef S)
Read YAML text into the MsgPack document. Returns false on failure.
std::string toString() const
Convert this node to a string, assuming it is scalar.
static NodeKind getKind(const DocNode &N)
static StringRef input(StringRef Str, StringRef Tag, void *Ctxt, ScalarDocNode &S)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DocNode getNode()
Create a nil node associated with this Document.
static void output(IO &IO, MapDocNode &M)
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
bool getHexMode() const
Get Hexmode flag.
StringRef fromString(StringRef S, StringRef Tag="")
Convert the StringRef and use it to set this DocNode (assuming scalar).
void toYAML(raw_ostream &OS)
Convert MsgPack Document to YAML text.
static void inputOne(IO &IO, StringRef Key, MapDocNode &M)
const char * toString(DWARFSectionKind Kind)
static ScalarDocNode & getAsScalar(DocNode &N)
static MapDocNode & getAsMap(DocNode &N)
A DocNode that is an array.
static size_t size(IO &IO, ArrayDocNode &A)
static void output(const ScalarDocNode &S, void *Ctxt, raw_ostream &OS, raw_ostream &TagOS)
std::string & str()
Returns the string's reference.