LLVM 22.0.0git
OutputBuffer Class Reference

#include "llvm/Demangle/Utility.h"

Public Member Functions

 OutputBuffer (char *StartBuf, size_t Size)
 OutputBuffer (char *StartBuf, size_t *SizePtr)
 OutputBuffer ()=default
 OutputBuffer (const OutputBuffer &)=delete
OutputBufferoperator= (const OutputBuffer &)=delete
virtual ~OutputBuffer ()=default
 operator std::string_view () const
virtual void printLeft (const Node &N)
 Called by the demangler when printing the demangle tree.
virtual void printRight (const Node &N)
virtual void notifyInsertion (size_t, size_t)
 Called when we write to this object anywhere other than the end.
virtual void notifyDeletion (size_t, size_t)
 Called when we make the CurrentPosition of this object smaller.
bool isInParensInTemplateArgs () const
 Returns true if we're currently between a '(' and ')' when printing template args.
bool isInsideTemplateArgs () const
 Returns true if we're printing template args.
void printOpen (char Open='(')
void printClose (char Close=')')
OutputBufferoperator+= (std::string_view R)
OutputBufferoperator+= (char C)
OutputBufferprepend (std::string_view R)
OutputBufferoperator<< (std::string_view R)
OutputBufferoperator<< (char C)
OutputBufferoperator<< (long long N)
OutputBufferoperator<< (unsigned long long N)
OutputBufferoperator<< (long N)
OutputBufferoperator<< (unsigned long N)
OutputBufferoperator<< (int N)
OutputBufferoperator<< (unsigned int N)
void insert (size_t Pos, const char *S, size_t N)
size_t getCurrentPosition () const
void setCurrentPosition (size_t NewPos)
char back () const
bool empty () const
chargetBuffer ()
chargetBufferEnd ()
size_t getBufferCapacity () const

Public Attributes

unsigned CurrentPackIndex = std::numeric_limits<unsigned>::max()
 If a ParameterPackExpansion (or similar type) is encountered, the offset into the pack that we're currently printing.
unsigned CurrentPackMax = std::numeric_limits<unsigned>::max()
struct { 
   unsigned   ParenDepth = 0 
 The depth of '(' and ')' inside the currently printed template arguments. More...
   bool   InsideTemplate = false 
 True if we're currently printing a template argument. More...
TemplateTracker

Detailed Description

Definition at line 34 of file Utility.h.

Constructor & Destructor Documentation

◆ OutputBuffer() [1/4]

OutputBuffer::OutputBuffer ( char * StartBuf,
size_t Size )
inline

◆ OutputBuffer() [2/4]

OutputBuffer::OutputBuffer ( char * StartBuf,
size_t * SizePtr )
inline

Definition at line 77 of file Utility.h.

References OutputBuffer().

◆ OutputBuffer() [3/4]

OutputBuffer::OutputBuffer ( )
default

◆ OutputBuffer() [4/4]

OutputBuffer::OutputBuffer ( const OutputBuffer & )
delete

References OutputBuffer().

◆ ~OutputBuffer()

virtual OutputBuffer::~OutputBuffer ( )
virtualdefault

Member Function Documentation

◆ back()

char OutputBuffer::back ( ) const
inline

Definition at line 213 of file Utility.h.

References DEMANGLE_ASSERT.

◆ empty()

bool OutputBuffer::empty ( ) const
inline

Definition at line 218 of file Utility.h.

◆ getBuffer()

char * OutputBuffer::getBuffer ( )
inline

◆ getBufferCapacity()

size_t OutputBuffer::getBufferCapacity ( ) const
inline

Definition at line 222 of file Utility.h.

◆ getBufferEnd()

char * OutputBuffer::getBufferEnd ( )
inline

Definition at line 221 of file Utility.h.

◆ getCurrentPosition()

size_t OutputBuffer::getCurrentPosition ( ) const
inline

Definition at line 207 of file Utility.h.

Referenced by decodePunycode(), llvm::dlangDemangle(), and removeNullBytes().

◆ insert()

void OutputBuffer::insert ( size_t Pos,
const char * S,
size_t N )
inline

Definition at line 194 of file Utility.h.

References DEMANGLE_ASSERT, N, and notifyInsertion().

Referenced by decodePunycode().

◆ isInParensInTemplateArgs()

bool OutputBuffer::isInParensInTemplateArgs ( ) const
inline

Returns true if we're currently between a '(' and ')' when printing template args.

Definition at line 118 of file Utility.h.

References TemplateTracker.

◆ isInsideTemplateArgs()

bool OutputBuffer::isInsideTemplateArgs ( ) const
inline

Returns true if we're printing template args.

Definition at line 123 of file Utility.h.

References TemplateTracker.

Referenced by printClose(), and printOpen().

◆ notifyDeletion()

virtual void OutputBuffer::notifyDeletion ( size_t ,
size_t  )
inlinevirtual

Called when we make the CurrentPosition of this object smaller.

Definition at line 100 of file Utility.h.

Referenced by setCurrentPosition().

◆ notifyInsertion()

virtual void OutputBuffer::notifyInsertion ( size_t ,
size_t  )
inlinevirtual

Called when we write to this object anywhere other than the end.

Definition at line 97 of file Utility.h.

Referenced by insert(), and prepend().

◆ operator std::string_view()

OutputBuffer::operator std::string_view ( ) const
inline

Definition at line 86 of file Utility.h.

◆ operator+=() [1/2]

OutputBuffer & OutputBuffer::operator+= ( char C)
inline

Definition at line 145 of file Utility.h.

References C(), and OutputBuffer().

◆ operator+=() [2/2]

OutputBuffer & OutputBuffer::operator+= ( std::string_view R)
inline

Definition at line 136 of file Utility.h.

References OutputBuffer(), and Size.

◆ operator<<() [1/8]

OutputBuffer & OutputBuffer::operator<< ( char C)
inline

Definition at line 168 of file Utility.h.

References C(), and OutputBuffer().

◆ operator<<() [2/8]

OutputBuffer & OutputBuffer::operator<< ( int N)
inline

Definition at line 186 of file Utility.h.

References N, and OutputBuffer().

◆ operator<<() [3/8]

OutputBuffer & OutputBuffer::operator<< ( long long N)
inline

Definition at line 170 of file Utility.h.

References N, and OutputBuffer().

◆ operator<<() [4/8]

OutputBuffer & OutputBuffer::operator<< ( long N)
inline

Definition at line 178 of file Utility.h.

References N, and OutputBuffer().

◆ operator<<() [5/8]

OutputBuffer & OutputBuffer::operator<< ( std::string_view R)
inline

Definition at line 166 of file Utility.h.

References OutputBuffer().

◆ operator<<() [6/8]

OutputBuffer & OutputBuffer::operator<< ( unsigned int N)
inline

Definition at line 190 of file Utility.h.

References N, and OutputBuffer().

◆ operator<<() [7/8]

OutputBuffer & OutputBuffer::operator<< ( unsigned long long N)
inline

Definition at line 174 of file Utility.h.

References N, and OutputBuffer().

◆ operator<<() [8/8]

OutputBuffer & OutputBuffer::operator<< ( unsigned long N)
inline

Definition at line 182 of file Utility.h.

References N, and OutputBuffer().

◆ operator=()

OutputBuffer & OutputBuffer::operator= ( const OutputBuffer & )
delete

References OutputBuffer().

◆ prepend()

OutputBuffer & OutputBuffer::prepend ( std::string_view R)
inline

Definition at line 151 of file Utility.h.

References notifyInsertion(), OutputBuffer(), and Size.

◆ printClose()

void OutputBuffer::printClose ( char Close = ')')
inline

Definition at line 130 of file Utility.h.

References isInsideTemplateArgs(), and TemplateTracker.

◆ printLeft()

void OutputBuffer::printLeft ( const Node & N)
inlinevirtual

Called by the demangler when printing the demangle tree.

By default calls into Node::print{Left|Right} but can be overriden by clients to track additional state when printing the demangled name.

Definition at line 6202 of file ItaniumDemangle.h.

References N.

◆ printOpen()

void OutputBuffer::printOpen ( char Open = '(')
inline

Definition at line 125 of file Utility.h.

References isInsideTemplateArgs(), and TemplateTracker.

◆ printRight()

void OutputBuffer::printRight ( const Node & N)
inlinevirtual

Definition at line 6204 of file ItaniumDemangle.h.

References N.

◆ setCurrentPosition()

void OutputBuffer::setCurrentPosition ( size_t NewPos)
inline

Definition at line 208 of file Utility.h.

References notifyDeletion().

Referenced by llvm::dlangDemangle(), and removeNullBytes().

Member Data Documentation

◆ CurrentPackIndex

unsigned OutputBuffer::CurrentPackIndex = std::numeric_limits<unsigned>::max()

If a ParameterPackExpansion (or similar type) is encountered, the offset into the pack that we're currently printing.

Definition at line 104 of file Utility.h.

◆ CurrentPackMax

unsigned OutputBuffer::CurrentPackMax = std::numeric_limits<unsigned>::max()

Definition at line 105 of file Utility.h.

◆ InsideTemplate

bool OutputBuffer::InsideTemplate = false

True if we're currently printing a template argument.

Definition at line 113 of file Utility.h.

◆ ParenDepth

unsigned OutputBuffer::ParenDepth = 0

The depth of '(' and ')' inside the currently printed template arguments.

Definition at line 110 of file Utility.h.

◆ [struct]

struct { ... } OutputBuffer::TemplateTracker

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