LLVM 20.0.0git
|
A node in a MsgPack Document. More...
#include "llvm/BinaryFormat/MsgPackDocument.h"
Public Types | |
typedef std::map< DocNode, DocNode > | MapTy |
typedef std::vector< DocNode > | ArrayTy |
Protected Attributes | |
union { | |
int64_t Int | |
uint64_t UInt | |
bool Bool | |
double Float | |
StringRef Raw | |
ArrayTy * Array | |
MapTy * Map | |
}; | |
Friends | |
bool | operator< (const DocNode &Lhs, const DocNode &Rhs) |
Comparison operator, used for map keys. | |
bool | operator== (const DocNode &Lhs, const DocNode &Rhs) |
Equality operator. | |
bool | operator!= (const DocNode &Lhs, const DocNode &Rhs) |
Inequality operator. | |
A node in a MsgPack Document.
This is a simple copyable and passable-by-value type that does not own any memory.
Definition at line 38 of file MsgPackDocument.h.
typedef std::vector<DocNode> llvm::msgpack::DocNode::ArrayTy |
Definition at line 43 of file MsgPackDocument.h.
typedef std::map<DocNode, DocNode> llvm::msgpack::DocNode::MapTy |
Definition at line 42 of file MsgPackDocument.h.
|
inline |
Definition at line 67 of file MsgPackDocument.h.
Convert the StringRef and use it to set this DocNode (assuming scalar).
If it is a string, copy the string into the Document's strings list so we do not rely on S having a lifetime beyond this call. Tag is "" or a YAML tag.
Definition at line 69 of file MsgPackDocumentYAML.cpp.
References assert(), getBool(), getDocument(), getFloat(), getInt(), llvm::msgpack::Document::getNode(), and getUInt().
|
inline |
Get an ArrayDocNode for an array node.
If Convert, convert the node to an array node if necessary.
Definition at line 134 of file MsgPackDocument.h.
References llvm::msgpack::Array, assert(), and getKind().
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitKernel().
|
inline |
Definition at line 127 of file MsgPackDocument.h.
References assert(), llvm::msgpack::Binary, getKind(), and Raw.
|
inline |
Definition at line 92 of file MsgPackDocument.h.
References assert(), Bool, llvm::msgpack::Boolean, and getKind().
Referenced by fromString().
|
inline |
Definition at line 112 of file MsgPackDocument.h.
References assert(), Bool, llvm::msgpack::Boolean, and getKind().
|
inline |
Definition at line 80 of file MsgPackDocument.h.
References llvm::msgpack::KindAndDocument::Doc.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitKernel(), llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitKernelAttrs(), llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV5::emitKernelAttrs(), llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitKernelLanguage(), llvm::msgpack::MapDocNode::find(), fromString(), getNode(), operator=(), llvm::msgpack::ArrayDocNode::operator[](), llvm::msgpack::MapDocNode::operator[](), llvm::msgpack::ArrayDocNode::push_back(), and toString().
|
inline |
Definition at line 97 of file MsgPackDocument.h.
References assert(), Float, llvm::msgpack::Float, and getKind().
Referenced by fromString().
|
inline |
Definition at line 117 of file MsgPackDocument.h.
References assert(), Float, llvm::msgpack::Float, and getKind().
|
inline |
Definition at line 82 of file MsgPackDocument.h.
References assert(), getKind(), Int, and llvm::msgpack::Int.
Referenced by fromString().
|
inline |
Definition at line 102 of file MsgPackDocument.h.
References assert(), getKind(), Int, and llvm::msgpack::Int.
|
inline |
Definition at line 79 of file MsgPackDocument.h.
References llvm::msgpack::KindAndDocument::Kind.
Referenced by llvm::msgpack::ArrayDocNode::ArrayDocNode(), getArray(), getBinary(), getBool(), getFloat(), getInt(), getMap(), getString(), getUInt(), isArray(), isEmpty(), isMap(), isString(), llvm::msgpack::MapDocNode::MapDocNode(), llvm::msgpack::Document::readFromBlob(), toString(), and llvm::AMDGPUPALMetadata::toString().
|
inline |
Get a MapDocNode for a map node.
If Convert, convert the node to a map node if necessary.
Definition at line 145 of file MsgPackDocument.h.
References assert(), getKind(), and llvm::msgpack::Map.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::getRootMetadata(), llvm::AMDGPUPALMetadata::setFromString(), llvm::AMDGPUPALMetadata::setGraphicsRegisters(), llvm::AMDGPUPALMetadata::toString(), and llvm::AMDGPU::HSAMD::V3::MetadataVerifier::verify().
|
inline |
Definition at line 122 of file MsgPackDocument.h.
References assert(), getKind(), Raw, and llvm::msgpack::String.
|
inline |
Definition at line 87 of file MsgPackDocument.h.
References assert(), getKind(), UInt, and llvm::msgpack::UInt.
Referenced by fromString().
|
inline |
Definition at line 107 of file MsgPackDocument.h.
References assert(), getKind(), UInt, and llvm::msgpack::UInt.
|
inline |
Definition at line 71 of file MsgPackDocument.h.
References llvm::msgpack::Array, and getKind().
Referenced by isScalar(), and llvm::msgpack::Document::readFromBlob().
|
inline |
Definition at line 78 of file MsgPackDocument.h.
References llvm::msgpack::Empty, and getKind().
Referenced by llvm::msgpack::Document::readFromBlob().
|
inline |
Definition at line 70 of file MsgPackDocument.h.
References getKind(), and llvm::msgpack::Map.
Referenced by isScalar(), llvm::msgpack::Document::readFromBlob(), and llvm::AMDGPU::HSAMD::V3::MetadataVerifier::verify().
|
inline |
Definition at line 72 of file MsgPackDocument.h.
|
inline |
Definition at line 73 of file MsgPackDocument.h.
References getKind(), and llvm::msgpack::String.
Definition at line 87 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
Convenience assignment operators.
This only works if the destination DocNode has an associated Document, i.e. it was not constructed using the default constructor. The string one does not copy, so the string must remain valid for the lifetime of the Document. Use fromString to avoid that restriction.
Definition at line 207 of file MsgPackDocument.h.
DocNode & DocNode::operator= | ( | int | Val | ) |
Definition at line 91 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
DocNode & DocNode::operator= | ( | int64_t | Val | ) |
Definition at line 99 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
DocNode & DocNode::operator= | ( | MemoryBufferRef | Val | ) |
Definition at line 83 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
Definition at line 79 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
Definition at line 103 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
Definition at line 95 of file MsgPackDocument.cpp.
References getDocument(), and llvm::msgpack::Document::getNode().
std::string DocNode::toString | ( | ) | const |
Convert this node to a string, assuming it is scalar.
Convert this DocNode to a string, assuming it is scalar.
Definition at line 35 of file MsgPackDocumentYAML.cpp.
References Bool, llvm::msgpack::Boolean, Float, llvm::msgpack::Float, llvm::format(), getDocument(), llvm::msgpack::Document::getHexMode(), getKind(), Int, llvm::msgpack::Int, llvm_unreachable, llvm::msgpack::Nil, OS, Raw, llvm::msgpack::String, UInt, and llvm::msgpack::UInt.
Inequality operator.
Definition at line 190 of file MsgPackDocument.h.
Comparison operator, used for map keys.
Definition at line 155 of file MsgPackDocument.h.
Equality operator.
Definition at line 185 of file MsgPackDocument.h.
union { ... } llvm::msgpack::DocNode::@169 |
ArrayTy* llvm::msgpack::DocNode::Array |
bool llvm::msgpack::DocNode::Bool |
Definition at line 57 of file MsgPackDocument.h.
Referenced by getBool(), and toString().
double llvm::msgpack::DocNode::Float |
Definition at line 58 of file MsgPackDocument.h.
Referenced by getFloat(), and toString().
int64_t llvm::msgpack::DocNode::Int |
Definition at line 55 of file MsgPackDocument.h.
Referenced by getInt(), and toString().
MapTy* llvm::msgpack::DocNode::Map |
Definition at line 61 of file MsgPackDocument.h.
Referenced by llvm::msgpack::MapDocNode::begin(), llvm::msgpack::MapDocNode::end(), llvm::msgpack::MapDocNode::erase(), llvm::msgpack::MapDocNode::find(), and llvm::msgpack::MapDocNode::size().
StringRef llvm::msgpack::DocNode::Raw |
Definition at line 59 of file MsgPackDocument.h.
Referenced by getBinary(), getString(), and toString().
uint64_t llvm::msgpack::DocNode::UInt |
Definition at line 56 of file MsgPackDocument.h.
Referenced by getUInt(), and toString().