|
LLVM
10.0.0
|
Simple in-memory representation of a document of msgpack objects with ability to find and create array and map elements. More...
#include "llvm/BinaryFormat/MsgPackDocument.h"
Public Member Functions | |
| Document () | |
| DocNode & | getRoot () |
| Get ref to the document's root element. More... | |
| void | clear () |
| Restore the Document to an empty state. More... | |
| DocNode | getNode () |
| Create a nil node associated with this Document. More... | |
| DocNode | getNode (int64_t V) |
| Create an Int node associated with this Document. More... | |
| DocNode | getNode (int V) |
| Create an Int node associated with this Document. More... | |
| DocNode | getNode (uint64_t V) |
| Create a UInt node associated with this Document. More... | |
| DocNode | getNode (unsigned V) |
| Create a UInt node associated with this Document. More... | |
| DocNode | getNode (bool V) |
| Create a Boolean node associated with this Document. More... | |
| DocNode | getNode (double V) |
| Create a Float node associated with this Document. More... | |
| DocNode | getNode (StringRef V, bool Copy=false) |
| Create a String node associated with this Document. More... | |
| DocNode | getNode (const char *V, bool Copy=false) |
| Create a String node associated with this Document. More... | |
| MapDocNode | getMapNode () |
| Create an empty Map node associated with this Document. More... | |
| ArrayDocNode | getArrayNode () |
| Create an empty Array node associated with this Document. More... | |
| bool | readFromBlob (StringRef Blob, bool Multi) |
| Read a MsgPack document from a binary MsgPack blob. More... | |
| void | writeToBlob (std::string &Blob) |
| Write a MsgPack document to a binary MsgPack blob. More... | |
| StringRef | addString (StringRef S) |
| Copy a string into the Document's strings list, and return the copy that is owned by the Document. More... | |
| void | setHexMode (bool Val=true) |
| Set whether YAML output uses hex for UInt. Default off. More... | |
| bool | getHexMode () const |
| Get Hexmode flag. More... | |
| void | toYAML (raw_ostream &OS) |
| Convert MsgPack Document to YAML text. More... | |
| bool | fromYAML (StringRef S) |
| Read YAML text into the MsgPack document. Returns false on failure. More... | |
Simple in-memory representation of a document of msgpack objects with ability to find and create array and map elements.
Does not currently cope with any extension types.
Definition at line 239 of file MsgPackDocument.h.
|
inline |
Definition at line 256 of file MsgPackDocument.h.
References clear(), llvm::msgpack::Extension, and llvm::T.
Copy a string into the Document's strings list, and return the copy that is owned by the Document.
Definition at line 363 of file MsgPackDocument.h.
References llvm::StringRef::data(), and llvm::StringRef::size().
|
inline |
Restore the Document to an empty state.
Definition at line 266 of file MsgPackDocument.h.
Read YAML text into the MsgPack document. Returns false on failure.
Definition at line 243 of file MsgPackDocumentYAML.cpp.
References clear().
Referenced by llvm::AMDGPUTargetStreamer::EmitHSAMetadataV3(), and llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel().
|
inline |
Create an empty Array node associated with this Document.
Definition at line 341 of file MsgPackDocument.h.
References llvm::msgpack::Array, and N.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel().
|
inline |
Get Hexmode flag.
Definition at line 373 of file MsgPackDocument.h.
|
inline |
Create an empty Map node associated with this Document.
Definition at line 333 of file MsgPackDocument.h.
References llvm::msgpack::Map, and N.
|
inline |
Create a nil node associated with this Document.
Definition at line 269 of file MsgPackDocument.h.
References N, and llvm::msgpack::Nil.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerV3::emitKernel(), llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel(), llvm::yaml::CustomMappingTraits< MapDocNode >::inputOne(), and llvm::msgpack::MapDocNode::operator[]().
|
inline |
Create an Int node associated with this Document.
Definition at line 275 of file MsgPackDocument.h.
References llvm::msgpack::Int, and N.
|
inline |
Create an Int node associated with this Document.
Definition at line 282 of file MsgPackDocument.h.
References llvm::msgpack::Int, and N.
|
inline |
Create a UInt node associated with this Document.
Definition at line 289 of file MsgPackDocument.h.
References N, and llvm::msgpack::UInt.
Create a UInt node associated with this Document.
Definition at line 296 of file MsgPackDocument.h.
References N, and llvm::msgpack::UInt.
Create a Boolean node associated with this Document.
Definition at line 303 of file MsgPackDocument.h.
References llvm::msgpack::Boolean, and N.
|
inline |
Create a Float node associated with this Document.
Definition at line 310 of file MsgPackDocument.h.
References llvm::msgpack::Float, and N.
Create a String node associated with this Document.
If !Copy, the passed string must remain valid for the lifetime of the Document.
Definition at line 318 of file MsgPackDocument.h.
References N, and llvm::msgpack::String.
Create a String node associated with this Document.
If !Copy, the passed string must remain valid for the lifetime of the Document.
Definition at line 328 of file MsgPackDocument.h.
|
inline |
Get ref to the document's root element.
Definition at line 263 of file MsgPackDocument.h.
Referenced by llvm::AMDGPUTargetAsmStreamer::EmitHSAMetadata(), and llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata().
Read a MsgPack document from a binary MsgPack blob.
The blob data must remain valid for the lifetime of this Document (because a string object in the document contains a StringRef into the original blob). If Multi, then this sets root to an array and adds top-level objects to it. If !Multi, then it only reads a single top-level object, even if there are more, and sets root to that. Returns false if failed due to illegal format.
Definition at line 76 of file MsgPackDocument.cpp.
References llvm::SmallVectorTemplateBase< T >::push_back(), llvm::msgpack::Reader::read(), and llvm::SmallVectorBase::size().
Set whether YAML output uses hex for UInt. Default off.
Definition at line 370 of file MsgPackDocument.h.
| void msgpack::Document::toYAML | ( | raw_ostream & | OS | ) |
Convert MsgPack Document to YAML text.
Definition at line 237 of file MsgPackDocumentYAML.cpp.
Referenced by llvm::AMDGPUTargetAsmStreamer::EmitHSAMetadata(), and llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitKernel().
| void Document::writeToBlob | ( | std::string & | Blob | ) |
Write a MsgPack document to a binary MsgPack blob.
Definition at line 179 of file MsgPackDocument.cpp.
Referenced by llvm::AMDGPUTargetELFStreamer::EmitHSAMetadata().
1.8.13