LLDB mainline
lldb_private::TrackingOutputBuffer Struct Reference

An OutputBuffer which keeps a record of where certain parts of a demangled name begin/end (e.g., basename, scope, argument list, etc.). More...

#include <DemangledNameInfo.h>

Inheritance diagram for lldb_private::TrackingOutputBuffer:
[legend]

Public Member Functions

void printLeft (const llvm::itanium_demangle::Node &N) override
void printRight (const llvm::itanium_demangle::Node &N) override

Public Attributes

DemangledNameInfo NameInfo
 Holds information about the demangled name that is being printed into this buffer.

Private Member Functions

void printLeftImpl (const llvm::itanium_demangle::FunctionType &N)
void printRightImpl (const llvm::itanium_demangle::FunctionType &N)
void printLeftImpl (const llvm::itanium_demangle::FunctionEncoding &N)
void printRightImpl (const llvm::itanium_demangle::FunctionEncoding &N)
void printLeftImpl (const llvm::itanium_demangle::NestedName &N)
void printLeftImpl (const llvm::itanium_demangle::NameWithTemplateArgs &N)
llvm::itanium_demangle::ScopedOverride< unsigned > enterFunctionTypePrinting ()
 Called whenever we start printing a function type in the Itanium mangling scheme.
bool isPrintingTopLevelFunctionType () const
 Returns true if we're not printing any nested function types, just a FunctionEncoding in the Itanium mangling scheme.
void updateBasenameEnd ()
 If this object shouldTrack, then update the end of the basename range to the current OB position.
void updateScopeStart ()
 If this object shouldTrack, then update the beginning of the scope range to the current OB position.
void updateScopeEnd ()
 If this object shouldTrack, then update the end of the scope range to the current OB position.
bool shouldTrack () const
 Returns true if the members of this object can be updated.
void finalizeArgumentEnd ()
 Helpers called to track beginning and end of the function arguments.
void finalizeStart ()
void finalizeEnd ()
void finalizeQualifiersStart ()
void finalizeQualifiersEnd ()
bool canFinalize () const
 Helper used in the finalize APIs.

Private Attributes

unsigned FunctionPrintingDepth = 0
 Incremented each time we start printing a function type node in the Itanium mangling scheme (e.g., FunctionEncoding or FunctionType).

Detailed Description

An OutputBuffer which keeps a record of where certain parts of a demangled name begin/end (e.g., basename, scope, argument list, etc.).

The tracking occurs during printing of the Itanium demangle tree.

Usage:

Node *N = mangling_parser.parseType();
N->printLeft(OB);
assert (buffer.NameInfo.hasBasename());
bool hasBasename() const
Returns true if this object holds a valid basename range.
An OutputBuffer which keeps a record of where certain parts of a demangled name begin/end (e....
void printLeft(const llvm::itanium_demangle::Node &N) override
DemangledNameInfo NameInfo
Holds information about the demangled name that is being printed into this buffer.

Definition at line 195 of file DemangledNameInfo.h.

Member Function Documentation

◆ canFinalize()

bool lldb_private::TrackingOutputBuffer::canFinalize ( ) const
private

Helper used in the finalize APIs.

Definition at line 104 of file DemangledNameInfo.cpp.

References isPrintingTopLevelFunctionType(), and NameInfo.

Referenced by finalizeArgumentEnd(), finalizeEnd(), finalizeQualifiersEnd(), finalizeQualifiersStart(), and finalizeStart().

◆ enterFunctionTypePrinting()

ScopedOverride< unsigned > lldb_private::TrackingOutputBuffer::enterFunctionTypePrinting ( )
nodiscardprivate

Called whenever we start printing a function type in the Itanium mangling scheme.

Examples include FunctionEncoding, FunctionType, etc.

Returns
A ScopedOverride which will update the nesting depth of currently printed function types on destruction.

Definition at line 197 of file DemangledNameInfo.cpp.

References FunctionPrintingDepth.

◆ finalizeArgumentEnd()

void lldb_private::TrackingOutputBuffer::finalizeArgumentEnd ( )
private

Helpers called to track beginning and end of the function arguments.

Definition at line 138 of file DemangledNameInfo.cpp.

References canFinalize(), and NameInfo.

◆ finalizeEnd()

void lldb_private::TrackingOutputBuffer::finalizeEnd ( )
private

Definition at line 183 of file DemangledNameInfo.cpp.

References canFinalize(), and NameInfo.

◆ finalizeQualifiersEnd()

void lldb_private::TrackingOutputBuffer::finalizeQualifiersEnd ( )
private

Definition at line 152 of file DemangledNameInfo.cpp.

References canFinalize(), and NameInfo.

◆ finalizeQualifiersStart()

void lldb_private::TrackingOutputBuffer::finalizeQualifiersStart ( )
private

Definition at line 145 of file DemangledNameInfo.cpp.

References canFinalize(), and NameInfo.

◆ finalizeStart()

void lldb_private::TrackingOutputBuffer::finalizeStart ( )
private

Definition at line 159 of file DemangledNameInfo.cpp.

References canFinalize(), NameInfo, and shouldTrack().

◆ isPrintingTopLevelFunctionType()

bool lldb_private::TrackingOutputBuffer::isPrintingTopLevelFunctionType ( ) const
private

Returns true if we're not printing any nested function types, just a FunctionEncoding in the Itanium mangling scheme.

Definition at line 201 of file DemangledNameInfo.cpp.

References FunctionPrintingDepth.

Referenced by canFinalize(), and shouldTrack().

◆ printLeft()

void lldb_private::TrackingOutputBuffer::printLeft ( const llvm::itanium_demangle::Node & N)
override

Definition at line 205 of file DemangledNameInfo.cpp.

References NameInfo, and printLeftImpl().

◆ printLeftImpl() [1/4]

void lldb_private::TrackingOutputBuffer::printLeftImpl ( const llvm::itanium_demangle::FunctionEncoding & N)
private

◆ printLeftImpl() [2/4]

void lldb_private::TrackingOutputBuffer::printLeftImpl ( const llvm::itanium_demangle::FunctionType & N)
private

Referenced by printLeft().

◆ printLeftImpl() [3/4]

void lldb_private::TrackingOutputBuffer::printLeftImpl ( const llvm::itanium_demangle::NameWithTemplateArgs & N)
private

◆ printLeftImpl() [4/4]

void lldb_private::TrackingOutputBuffer::printLeftImpl ( const llvm::itanium_demangle::NestedName & N)
private

◆ printRight()

void lldb_private::TrackingOutputBuffer::printRight ( const llvm::itanium_demangle::Node & N)
override

Definition at line 227 of file DemangledNameInfo.cpp.

References NameInfo, and printRightImpl().

◆ printRightImpl() [1/2]

void lldb_private::TrackingOutputBuffer::printRightImpl ( const llvm::itanium_demangle::FunctionEncoding & N)
private

◆ printRightImpl() [2/2]

void lldb_private::TrackingOutputBuffer::printRightImpl ( const llvm::itanium_demangle::FunctionType & N)
private

Referenced by printRight().

◆ shouldTrack()

bool lldb_private::TrackingOutputBuffer::shouldTrack ( ) const
private

Returns true if the members of this object can be updated.

E.g., when we're printing nested template arguments, we don't need to be tracking basename locations.

Definition at line 91 of file DemangledNameInfo.cpp.

References isPrintingTopLevelFunctionType(), and NameInfo.

Referenced by finalizeStart(), updateBasenameEnd(), updateScopeEnd(), and updateScopeStart().

◆ updateBasenameEnd()

void lldb_private::TrackingOutputBuffer::updateBasenameEnd ( )
private

If this object shouldTrack, then update the end of the basename range to the current OB position.

Definition at line 117 of file DemangledNameInfo.cpp.

References NameInfo, and shouldTrack().

◆ updateScopeEnd()

void lldb_private::TrackingOutputBuffer::updateScopeEnd ( )
private

If this object shouldTrack, then update the end of the scope range to the current OB position.

Definition at line 131 of file DemangledNameInfo.cpp.

References NameInfo, and shouldTrack().

◆ updateScopeStart()

void lldb_private::TrackingOutputBuffer::updateScopeStart ( )
private

If this object shouldTrack, then update the beginning of the scope range to the current OB position.

Definition at line 124 of file DemangledNameInfo.cpp.

References NameInfo, and shouldTrack().

Member Data Documentation

◆ FunctionPrintingDepth

unsigned lldb_private::TrackingOutputBuffer::FunctionPrintingDepth = 0
private

Incremented each time we start printing a function type node in the Itanium mangling scheme (e.g., FunctionEncoding or FunctionType).

Definition at line 260 of file DemangledNameInfo.h.

Referenced by enterFunctionTypePrinting(), and isPrintingTopLevelFunctionType().

◆ NameInfo

DemangledNameInfo lldb_private::TrackingOutputBuffer::NameInfo

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