24 ScalarDocNode(DocNode
N) : DocNode(
N) {}
29 StringRef getYAMLTag()
const;
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");
110StringRef ScalarDocNode::getYAMLTag()
const {
115 ScalarDocNode
N = getDocument()->getNode();
117 if (
N.getKind() == getKind())
149 switch (
N.getKind()) {
167 return *
static_cast<ScalarDocNode *
>(&
N);
176 TagOS << S.getYAMLTag();
182 return S.fromString(Str,
Tag);
186 switch (S.getKind()) {
210 ScalarDocNode KeyObj = M.getDocument()->getNode();
211 KeyObj.fromString(
Key,
"");
216 for (
auto I : M.getMap()) {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static DeltaTreeNode * getRoot(void *Root)
This file declares a class that exposes a simple in-memory representation of a document of MsgPack ob...
StringRef - Represent a constant reference to a string, i.e.
A DocNode that is an array.
A node in a MsgPack Document.
LLVM_ABI StringRef fromString(StringRef S, StringRef Tag="")
Convert the StringRef and use it to set this DocNode (assuming scalar).
LLVM_ABI std::string toString() const
Convert this node to a string, assuming it is scalar.
Document * getDocument() const
void clear()
Restore the Document to an empty state.
DocNode getNode()
Create a nil node associated with this Document.
LLVM_ABI void toYAML(raw_ostream &OS)
Convert MsgPack Document to YAML text.
LLVM_ABI bool fromYAML(StringRef S)
Read YAML text into the MsgPack document. Returns false on failure.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
void mapRequired(const char *Key, T &Val)
The Output class is used to generate a yaml document from in-memory structs and vectors.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
QuotingType
Describe which type of quotes should be used when quoting is necessary.
This is an optimization pass for GlobalISel generic memory operations.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)
static void inputOne(IO &IO, StringRef Key, MapDocNode &M)
static void output(IO &IO, MapDocNode &M)
This class should be specialized by any type that needs to be converted to/from a YAML mapping in the...
static NodeKind getKind(const DocNode &N)
static ArrayDocNode & getAsSequence(DocNode &N)
static MapDocNode & getAsMap(DocNode &N)
static ScalarDocNode & getAsScalar(DocNode &N)
This class should be specialized by any type that can be represented as a scalar, map,...
This class should be specialized by type that requires custom conversion to/from a yaml scalar.
static size_t size(IO &IO, ArrayDocNode &A)
static DocNode & element(IO &IO, ArrayDocNode &A, size_t Index)
This class should be specialized by any type that needs to be converted to/from a YAML sequence.
static StringRef input(StringRef Str, StringRef Tag, void *Ctxt, ScalarDocNode &S)
static void output(const ScalarDocNode &S, void *Ctxt, raw_ostream &OS, raw_ostream &TagOS)
static QuotingType mustQuote(const ScalarDocNode &S, StringRef ScalarStr)
This class should be specialized by type that requires custom conversion to/from a YAML scalar with o...