LLVM 23.0.0git
llvm::yaml::Output Class Reference

The Output class is used to generate a yaml document from in-memory structs and vectors. More...

#include "llvm/Support/YAMLTraits.h"

Inheritance diagram for llvm::yaml::Output:
[legend]

Public Member Functions

 Output (raw_ostream &, void *Ctxt=nullptr, int WrapColumn=70)
 ~Output () override
void setWriteDefaultValues (bool Write)
 Set whether or not to output optional values which are equal to the default value. By default, when outputting if you attempt to write a value that is equal to the default, the value gets ignored. Sometimes, it is useful to be able to see these in the resulting YAML anyway.
bool outputting () const override
bool mapTag (StringRef, bool) override
void beginMapping () override
void endMapping () override
bool preflightKey (StringRef Key, bool, bool, bool &, void *&) override
void postflightKey (void *) override
std::vector< StringRefkeys () override
void beginFlowMapping () override
void endFlowMapping () override
unsigned beginSequence () override
void endSequence () override
bool preflightElement (unsigned, void *&) override
void postflightElement (void *) override
unsigned beginFlowSequence () override
bool preflightFlowElement (unsigned, void *&) override
void postflightFlowElement (void *) override
void endFlowSequence () override
void beginEnumScalar () override
bool matchEnumScalar (StringRef, bool) override
bool matchEnumFallback () override
void endEnumScalar () override
bool beginBitSetScalar (bool &) override
bool bitSetMatch (StringRef, bool) override
void endBitSetScalar () override
void scalarString (StringRef &, QuotingType) override
void blockScalarString (StringRef &) override
void scalarTag (std::string &) override
NodeKind getNodeKind () override
void setError (const Twine &message) override
std::error_code error () override
bool canElideEmptySequence () override
void beginDocuments ()
bool preflightDocument (unsigned)
void postflightDocument ()
void endDocuments ()
Public Member Functions inherited from llvm::yaml::IO
 IO (void *Ctxt=nullptr)
virtual ~IO ()
virtual void setAllowUnknownKeys (bool Allow)
template<typename T>
void enumCase (T &Val, StringRef Str, const T ConstVal)
template<typename T>
void enumCase (T &Val, StringRef Str, const uint32_t ConstVal)
template<typename FBT, typename T>
void enumFallback (T &Val)
template<typename T>
void bitSetCase (T &Val, StringRef Str, const T ConstVal)
template<typename T>
void bitSetCase (T &Val, StringRef Str, const uint32_t ConstVal)
template<typename T>
void maskedBitSetCase (T &Val, StringRef Str, T ConstVal, T Mask)
template<typename T>
void maskedBitSetCase (T &Val, StringRef Str, uint32_t ConstVal, uint32_t Mask)
void * getContext () const
void setContext (void *)
template<typename T>
void mapRequired (StringRef Key, T &Val)
template<typename T, typename Context>
void mapRequired (StringRef Key, T &Val, Context &Ctx)
template<typename T>
void mapOptional (StringRef Key, T &Val)
template<typename T, typename DefaultT>
void mapOptional (StringRef Key, T &Val, const DefaultT &Default)
template<typename T, typename Context>
void mapOptionalWithContext (StringRef Key, T &Val, Context &Ctx)
template<typename T, typename Context>
void mapOptionalWithContext (StringRef Key, std::optional< T > &Val, Context &Ctx)
template<typename T, typename Context, typename DefaultT>
void mapOptionalWithContext (StringRef Key, T &Val, const DefaultT &Default, Context &Ctx)

Detailed Description

The Output class is used to generate a yaml document from in-memory structs and vectors.

Definition at line 1472 of file YAMLTraits.h.

Constructor & Destructor Documentation

◆ Output()

Output::Output ( raw_ostream & yout,
void * Ctxt = nullptr,
int WrapColumn = 70 )

Definition at line 514 of file YAMLTraits.cpp.

References llvm::yaml::IO::IO().

◆ ~Output()

Output::~Output ( )
overridedefault

Member Function Documentation

◆ beginBitSetScalar()

bool Output::beginBitSetScalar ( bool & DoClear)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 721 of file YAMLTraits.cpp.

◆ beginDocuments()

void Output::beginDocuments ( )

Definition at line 614 of file YAMLTraits.cpp.

◆ beginEnumScalar()

void Output::beginEnumScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 696 of file YAMLTraits.cpp.

◆ beginFlowMapping()

void Output::beginFlowMapping ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 602 of file YAMLTraits.cpp.

◆ beginFlowSequence()

unsigned Output::beginFlowSequence ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 664 of file YAMLTraits.cpp.

◆ beginMapping()

void Output::beginMapping ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 523 of file YAMLTraits.cpp.

Referenced by llvm::convertCtxProfToYaml().

◆ beginSequence()

unsigned Output::beginSequence ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 631 of file YAMLTraits.cpp.

◆ bitSetMatch()

bool Output::bitSetMatch ( StringRef Str,
bool Matches )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 729 of file YAMLTraits.cpp.

◆ blockScalarString()

void Output::blockScalarString ( StringRef & S)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 755 of file YAMLTraits.cpp.

References llvm::MemoryBuffer::getMemBuffer(), and I.

◆ canElideEmptySequence()

bool Output::canElideEmptySequence ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 786 of file YAMLTraits.cpp.

◆ endBitSetScalar()

void Output::endBitSetScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 739 of file YAMLTraits.cpp.

◆ endDocuments()

void Output::endDocuments ( )

Definition at line 627 of file YAMLTraits.cpp.

◆ endEnumScalar()

void Output::endEnumScalar ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 716 of file YAMLTraits.cpp.

References llvm_unreachable.

◆ endFlowMapping()

void Output::endFlowMapping ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 609 of file YAMLTraits.cpp.

◆ endFlowSequence()

void Output::endFlowSequence ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 673 of file YAMLTraits.cpp.

◆ endMapping()

void Output::endMapping ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 560 of file YAMLTraits.cpp.

Referenced by llvm::convertCtxProfToYaml().

◆ endSequence()

void Output::endSequence ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 638 of file YAMLTraits.cpp.

◆ error()

std::error_code Output::error ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 784 of file YAMLTraits.cpp.

◆ getNodeKind()

NodeKind Output::getNodeKind ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 933 of file YAMLTraits.cpp.

References llvm::report_fatal_error().

◆ keys()

std::vector< StringRef > Output::keys ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 571 of file YAMLTraits.cpp.

References llvm::report_fatal_error().

◆ mapTag()

bool Output::mapTag ( StringRef Tag,
bool Use )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 529 of file YAMLTraits.cpp.

References llvm::Tag.

◆ matchEnumFallback()

bool Output::matchEnumFallback ( )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 709 of file YAMLTraits.cpp.

◆ matchEnumScalar()

bool Output::matchEnumScalar ( StringRef Str,
bool Match )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 700 of file YAMLTraits.cpp.

◆ outputting()

bool Output::outputting ( ) const
overridevirtual

Implements llvm::yaml::IO.

Definition at line 519 of file YAMLTraits.cpp.

◆ postflightDocument()

void Output::postflightDocument ( )

Definition at line 624 of file YAMLTraits.cpp.

◆ postflightElement()

void Output::postflightElement ( void * )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 654 of file YAMLTraits.cpp.

◆ postflightFlowElement()

void Output::postflightFlowElement ( void * )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 692 of file YAMLTraits.cpp.

◆ postflightKey()

void Output::postflightKey ( void * )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 592 of file YAMLTraits.cpp.

Referenced by llvm::convertCtxProfToYaml().

◆ preflightDocument()

bool Output::preflightDocument ( unsigned index)

Definition at line 618 of file YAMLTraits.cpp.

◆ preflightElement()

bool Output::preflightElement ( unsigned ,
void *& SaveInfo )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 649 of file YAMLTraits.cpp.

◆ preflightFlowElement()

bool Output::preflightFlowElement ( unsigned ,
void *& SaveInfo )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 678 of file YAMLTraits.cpp.

◆ preflightKey()

bool Output::preflightKey ( StringRef Key,
bool Required,
bool SameAsDefault,
bool & UseDefault,
void *& SaveInfo )
overridevirtual

◆ scalarString()

void Output::scalarString ( StringRef & S,
QuotingType MustQuote )
overridevirtual

Implements llvm::yaml::IO.

Definition at line 743 of file YAMLTraits.cpp.

References llvm::StringRef::empty().

◆ scalarTag()

void Output::scalarTag ( std::string & Tag)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 773 of file YAMLTraits.cpp.

References llvm::Tag.

◆ setError()

void Output::setError ( const Twine & message)
overridevirtual

Implements llvm::yaml::IO.

Definition at line 781 of file YAMLTraits.cpp.

◆ setWriteDefaultValues()

void llvm::yaml::Output::setWriteDefaultValues ( bool Write)
inline

Set whether or not to output optional values which are equal to the default value. By default, when outputting if you attempt to write a value that is equal to the default, the value gets ignored. Sometimes, it is useful to be able to see these in the resulting YAML anyway.

Definition at line 1482 of file YAMLTraits.h.

References llvm::Write.

Referenced by printMF().


The documentation for this class was generated from the following files: