9#ifndef LLDB_CORE_DEMANGLEDNAMEINFO_H
10#define LLDB_CORE_DEMANGLEDNAMEINFO_H
14#include "llvm/ADT/DenseMap.h"
15#include "llvm/Demangle/ItaniumDemangle.h"
16#include "llvm/Demangle/Utility.h"
149 std::optional<DemangledNameInfo>
Get(
const Mangled &mangled);
167 llvm::DenseMap<ConstString, std::optional<DemangledNameInfo>>
infos;
196 using OutputBuffer::OutputBuffer;
202 void printLeft(
const llvm::itanium_demangle::Node &N)
override;
203 void printRight(
const llvm::itanium_demangle::Node &N)
override;
221 [[nodiscard]] llvm::itanium_demangle::ScopedOverride<unsigned>
A cache from mangled names to DemangledNameInfo.
size_t GetMaxEntries() const
void SetMaxEntries(size_t max_entries)
Changes the maximum number of entries. A limit of 0 disables the cache.
size_t GetNumEntries() const
std::optional< DemangledNameInfo > Get(const Mangled &mangled)
Calculates the DemangledNameInfo and caches the result.
Bundles a value of type T with the Mutex that guards it.
A class that handles mangled names.
A class that represents a running process on the host machine.
std::vector< ConstString > mangled_names
The mangled names.
llvm::DenseMap< ConstString, std::optional< DemangledNameInfo > > infos
Maps a ConstString to its DemangledNameInfo.
void EvictRandomEntry()
Drops a random entry from the cache.
Stores information about where certain portions of a demangled function name begin and end.
bool hasSuffix() const
Returns true if this object holds a valid suffix range.
bool hasBasename() const
Returns true if this object holds a valid basename range.
std::pair< uint32_t, uint32_t > NameQualifiersRange
Indicates the [start, end) of the function's name qualifiers.
bool hasPrefix() const
Returns true if this object holds a valid prefix range.
std::pair< uint32_t, uint32_t > TemplateArgumentsRange
A [start, end) pair for the function template arguments.
bool hasTemplateArguments() const
Returns true if this object holds a valid template arguments range.
std::pair< uint32_t, uint32_t > PrefixRange
Indicates the [start, end) of the function's prefix.
std::pair< uint32_t, uint32_t > QualifiersRange
Indicates the [start, end) of the function qualifiers (e.g., CV-qualifiers, reference qualifiers,...
std::pair< uint32_t, uint32_t > BasenameRange
A [start, end) pair for the function basename.
std::pair< uint32_t, uint32_t > SuffixRange
Indicates the [start, end) of the function's suffix.
bool hasScope() const
Returns true if this object holds a valid scope range.
bool hasNameQualifiers() const
Returns true if this object holds a valid name qualifiers range.
std::pair< uint32_t, uint32_t > ScopeRange
A [start, end) pair for the function scope qualifiers.
bool hasQualifiers() const
Returns true if this object holds a valid qualifiers range.
std::pair< uint32_t, uint32_t > ArgumentsRange
Indicates the [start, end) of the function argument list.
bool hasArguments() const
Returns true if this object holds a valid arguments range.
An OutputBuffer which keeps a record of where certain parts of a demangled name begin/end (e....
void updateScopeStart()
If this object shouldTrack, then update the beginning of the scope range to the current OB position.
void printLeftImpl(const llvm::itanium_demangle::NameWithTemplateArgs &N)
bool canFinalize() const
Helper used in the finalize APIs.
void printRightImpl(const llvm::itanium_demangle::FunctionType &N)
void printLeftImpl(const llvm::itanium_demangle::FunctionType &N)
bool isPrintingTopLevelFunctionType() const
Returns true if we're not printing any nested function types, just a FunctionEncoding in the Itanium ...
llvm::itanium_demangle::ScopedOverride< unsigned > enterFunctionTypePrinting()
Called whenever we start printing a function type in the Itanium mangling scheme.
void printLeftImpl(const llvm::itanium_demangle::FunctionEncoding &N)
void updateBasenameEnd()
If this object shouldTrack, then update the end of the basename range to the current OB position.
unsigned FunctionPrintingDepth
Incremented each time we start printing a function type node in the Itanium mangling scheme (e....
void finalizeQualifiersEnd()
void printLeft(const llvm::itanium_demangle::Node &N) override
void printRightImpl(const llvm::itanium_demangle::FunctionEncoding &N)
void finalizeArgumentEnd()
Helpers called to track beginning and end of the function arguments.
void updateScopeEnd()
If this object shouldTrack, then update the end of the scope range to the current OB position.
void printLeftImpl(const llvm::itanium_demangle::NestedName &N)
void printRight(const llvm::itanium_demangle::Node &N) override
bool shouldTrack() const
Returns true if the members of this object can be updated.
void finalizeQualifiersStart()
DemangledNameInfo NameInfo
Holds information about the demangled name that is being printed into this buffer.