LLVM  8.0.1
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::itanium_demangle::Node Class Referenceabstract

#include "llvm/Demangle/ItaniumDemangle.h"

Inherited by llvm::itanium_demangle::AbiTagAttr, llvm::itanium_demangle::ArraySubscriptExpr, llvm::itanium_demangle::ArrayType, llvm::itanium_demangle::BinaryExpr, llvm::itanium_demangle::BoolExpr, llvm::itanium_demangle::BracedExpr, llvm::itanium_demangle::BracedRangeExpr, llvm::itanium_demangle::CallExpr, llvm::itanium_demangle::CastExpr, llvm::itanium_demangle::ClosureTypeName, llvm::itanium_demangle::ConditionalExpr, llvm::itanium_demangle::ConversionExpr, llvm::itanium_demangle::ConversionOperatorType, llvm::itanium_demangle::CtorDtorName, llvm::itanium_demangle::CtorVtableSpecialName, llvm::itanium_demangle::DeleteExpr, llvm::itanium_demangle::DotSuffix, llvm::itanium_demangle::DtorName, llvm::itanium_demangle::DynamicExceptionSpec, llvm::itanium_demangle::ElaboratedTypeSpefType, llvm::itanium_demangle::EnableIfAttr, llvm::itanium_demangle::EnclosingExpr, llvm::itanium_demangle::ExpandedSpecialSubstitution, llvm::itanium_demangle::FloatLiteralImpl< Float >, llvm::itanium_demangle::FoldExpr, llvm::itanium_demangle::ForwardTemplateReference, llvm::itanium_demangle::FunctionEncoding, llvm::itanium_demangle::FunctionParam, llvm::itanium_demangle::FunctionType, llvm::itanium_demangle::GlobalQualifiedName, llvm::itanium_demangle::InitListExpr, llvm::itanium_demangle::IntegerCastExpr, llvm::itanium_demangle::IntegerLiteral, llvm::itanium_demangle::LiteralOperator, llvm::itanium_demangle::LocalName, llvm::itanium_demangle::MemberExpr, llvm::itanium_demangle::NameType, llvm::itanium_demangle::NameWithTemplateArgs, llvm::itanium_demangle::NestedName, llvm::itanium_demangle::NewExpr, llvm::itanium_demangle::NodeArrayNode, llvm::itanium_demangle::NoexceptSpec, llvm::itanium_demangle::ObjCProtoName, llvm::itanium_demangle::ParameterPack, llvm::itanium_demangle::ParameterPackExpansion, llvm::itanium_demangle::PixelVectorType, llvm::itanium_demangle::PointerToMemberType, llvm::itanium_demangle::PointerType, llvm::itanium_demangle::PostfixExpr, llvm::itanium_demangle::PostfixQualifiedType, llvm::itanium_demangle::PrefixExpr, llvm::itanium_demangle::QualifiedName, llvm::itanium_demangle::QualType, llvm::itanium_demangle::ReferenceType, llvm::itanium_demangle::SizeofParamPackExpr, llvm::itanium_demangle::SpecialName, llvm::itanium_demangle::SpecialSubstitution, llvm::itanium_demangle::StdQualifiedName, llvm::itanium_demangle::StructuredBindingName, llvm::itanium_demangle::TemplateArgs, llvm::itanium_demangle::TemplateArgumentPack, llvm::itanium_demangle::ThrowExpr, llvm::itanium_demangle::UnnamedTypeName, llvm::itanium_demangle::VectorType, and llvm::itanium_demangle::VendorExtQualType.

Collaboration diagram for llvm::itanium_demangle::Node:
Collaboration graph
[legend]

Public Types

enum  Kind : unsigned char
 
enum  Cache : unsigned char { Cache::Yes, Cache::No, Cache::Unknown }
 Three-way bool to track a cached value. More...
 

Public Member Functions

 Node (Kind K_, Cache RHSComponentCache_=Cache::No, Cache ArrayCache_=Cache::No, Cache FunctionCache_=Cache::No)
 
template<typename Fn >
void visit (Fn F) const
 Visit the most-derived object corresponding to this object. More...
 
bool hasRHSComponent (OutputStream &S) const
 
bool hasArray (OutputStream &S) const
 
bool hasFunction (OutputStream &S) const
 
Kind getKind () const
 
virtual bool hasRHSComponentSlow (OutputStream &) const
 
virtual bool hasArraySlow (OutputStream &) const
 
virtual bool hasFunctionSlow (OutputStream &) const
 
virtual const NodegetSyntaxNode (OutputStream &) const
 
void print (OutputStream &S) const
 
virtual void printLeft (OutputStream &) const =0
 
virtual void printRight (OutputStream &) const
 
virtual StringView getBaseName () const
 
virtual ~Node ()=default
 
LLVM_DUMP_METHOD void dump () const
 

Public Attributes

Cache RHSComponentCache
 Tracks if this node has a component on its right side, in which case we need to call printRight. More...
 
Cache ArrayCache
 Track if this node is a (possibly qualified) array type. More...
 
Cache FunctionCache
 Track if this node is a (possibly qualified) function type. More...
 

Detailed Description

Definition at line 102 of file ItaniumDemangle.h.

Member Enumeration Documentation

◆ Cache

Three-way bool to track a cached value.

Unknown is possible if this node has an unexpanded parameter pack below it that may affect this cache.

Enumerator
Yes 
No 
Unknown 

Definition at line 112 of file ItaniumDemangle.h.

◆ Kind

Definition at line 104 of file ItaniumDemangle.h.

Constructor & Destructor Documentation

◆ Node()

llvm::itanium_demangle::Node::Node ( Kind  K_,
Cache  RHSComponentCache_ = Cache::No,
Cache  ArrayCache_ = Cache::No,
Cache  FunctionCache_ = Cache::No 
)
inline

Definition at line 132 of file ItaniumDemangle.h.

References F(), and visit().

◆ ~Node()

virtual llvm::itanium_demangle::Node::~Node ( )
virtualdefault

Referenced by getBaseName().

Member Function Documentation

◆ dump()

void itanium_demangle::Node::dump ( ) const

Definition at line 239 of file ItaniumDemangle.cpp.

References N.

Referenced by getBaseName().

◆ getBaseName()

virtual StringView llvm::itanium_demangle::Node::getBaseName ( ) const
inlinevirtual

◆ getKind()

Kind llvm::itanium_demangle::Node::getKind ( ) const
inline

◆ getSyntaxNode()

virtual const Node* llvm::itanium_demangle::Node::getSyntaxNode ( OutputStream ) const
inlinevirtual

◆ hasArray()

bool llvm::itanium_demangle::Node::hasArray ( OutputStream S) const
inline

◆ hasArraySlow()

virtual bool llvm::itanium_demangle::Node::hasArraySlow ( OutputStream ) const
inlinevirtual

◆ hasFunction()

bool llvm::itanium_demangle::Node::hasFunction ( OutputStream S) const
inline

◆ hasFunctionSlow()

virtual bool llvm::itanium_demangle::Node::hasFunctionSlow ( OutputStream ) const
inlinevirtual

◆ hasRHSComponent()

bool llvm::itanium_demangle::Node::hasRHSComponent ( OutputStream S) const
inline

◆ hasRHSComponentSlow()

virtual bool llvm::itanium_demangle::Node::hasRHSComponentSlow ( OutputStream ) const
inlinevirtual

◆ print()

void llvm::itanium_demangle::Node::print ( OutputStream S) const
inline

Definition at line 176 of file ItaniumDemangle.h.

References No, printLeft(), and printRight().

Referenced by llvm::ItaniumPartialDemangler::getFunctionDeclContextName(), llvm::itaniumDemangle(), llvm::itanium_demangle::ElaboratedTypeSpefType::printLeft(), llvm::itanium_demangle::ObjCProtoName::printLeft(), llvm::itanium_demangle::NoexceptSpec::printLeft(), llvm::itanium_demangle::FunctionEncoding::printLeft(), llvm::itanium_demangle::LiteralOperator::printLeft(), llvm::itanium_demangle::SpecialName::printLeft(), llvm::itanium_demangle::CtorVtableSpecialName::printLeft(), llvm::itanium_demangle::NestedName::printLeft(), llvm::itanium_demangle::LocalName::printLeft(), llvm::itanium_demangle::QualifiedName::printLeft(), llvm::itanium_demangle::VectorType::printLeft(), llvm::itanium_demangle::NameWithTemplateArgs::printLeft(), llvm::itanium_demangle::StdQualifiedName::printLeft(), llvm::itanium_demangle::BinaryExpr::printLeft(), llvm::itanium_demangle::ArraySubscriptExpr::printLeft(), llvm::itanium_demangle::PostfixExpr::printLeft(), llvm::itanium_demangle::ConditionalExpr::printLeft(), llvm::itanium_demangle::MemberExpr::printLeft(), llvm::itanium_demangle::EnclosingExpr::printLeft(), llvm::itanium_demangle::CallExpr::printLeft(), llvm::itanium_demangle::NewExpr::printLeft(), llvm::itanium_demangle::DeleteExpr::printLeft(), llvm::itanium_demangle::PrefixExpr::printLeft(), llvm::itanium_demangle::ConversionExpr::printLeft(), llvm::itanium_demangle::InitListExpr::printLeft(), llvm::itanium_demangle::BracedExpr::printLeft(), llvm::itanium_demangle::BracedRangeExpr::printLeft(), llvm::itanium_demangle::FoldExpr::printLeft(), llvm::itanium_demangle::ThrowExpr::printLeft(), llvm::itanium_demangle::IntegerCastExpr::printLeft(), printNode(), llvm::itanium_demangle::ArrayType::printRight(), llvm::itanium_demangle::FunctionType::printRight(), llvm::itanium_demangle::FunctionEncoding::printRight(), and llvm::itanium_demangle::NodeArray::printWithComma().

◆ printLeft()

virtual void llvm::itanium_demangle::Node::printLeft ( OutputStream ) const
pure virtual

Implemented in llvm::itanium_demangle::FloatLiteralImpl< Float >, llvm::itanium_demangle::IntegerLiteral, llvm::itanium_demangle::IntegerCastExpr, llvm::itanium_demangle::BoolExpr, llvm::itanium_demangle::ThrowExpr, llvm::itanium_demangle::FoldExpr, llvm::itanium_demangle::BracedRangeExpr, llvm::itanium_demangle::BracedExpr, llvm::itanium_demangle::InitListExpr, llvm::itanium_demangle::ConversionExpr, llvm::itanium_demangle::FunctionParam, llvm::itanium_demangle::PrefixExpr, llvm::itanium_demangle::DeleteExpr, llvm::itanium_demangle::NewExpr, llvm::itanium_demangle::CallExpr, llvm::itanium_demangle::SizeofParamPackExpr, llvm::itanium_demangle::CastExpr, llvm::itanium_demangle::EnclosingExpr, llvm::itanium_demangle::MemberExpr, llvm::itanium_demangle::ConditionalExpr, llvm::itanium_demangle::PostfixExpr, llvm::itanium_demangle::ArraySubscriptExpr, llvm::itanium_demangle::BinaryExpr, llvm::itanium_demangle::StructuredBindingName, llvm::itanium_demangle::ClosureTypeName, llvm::itanium_demangle::UnnamedTypeName, llvm::itanium_demangle::DtorName, llvm::itanium_demangle::CtorDtorName, llvm::itanium_demangle::SpecialSubstitution, llvm::itanium_demangle::ExpandedSpecialSubstitution, llvm::itanium_demangle::StdQualifiedName, llvm::itanium_demangle::GlobalQualifiedName, llvm::itanium_demangle::NameWithTemplateArgs, llvm::itanium_demangle::ForwardTemplateReference, llvm::itanium_demangle::TemplateArgs, llvm::itanium_demangle::ParameterPackExpansion, llvm::itanium_demangle::TemplateArgumentPack, llvm::itanium_demangle::ParameterPack, llvm::itanium_demangle::PixelVectorType, llvm::itanium_demangle::VectorType, llvm::itanium_demangle::QualifiedName, llvm::itanium_demangle::LocalName, llvm::itanium_demangle::NestedName, llvm::itanium_demangle::CtorVtableSpecialName, llvm::itanium_demangle::SpecialName, llvm::itanium_demangle::LiteralOperator, llvm::itanium_demangle::FunctionEncoding, llvm::itanium_demangle::DynamicExceptionSpec, llvm::itanium_demangle::NoexceptSpec, llvm::itanium_demangle::FunctionType, llvm::itanium_demangle::ArrayType, llvm::itanium_demangle::PointerToMemberType, llvm::itanium_demangle::ReferenceType, llvm::itanium_demangle::PointerType, llvm::itanium_demangle::ObjCProtoName, llvm::itanium_demangle::EnableIfAttr, llvm::itanium_demangle::AbiTagAttr, llvm::itanium_demangle::ElaboratedTypeSpefType, llvm::itanium_demangle::NameType, llvm::itanium_demangle::PostfixQualifiedType, llvm::itanium_demangle::ConversionOperatorType, llvm::itanium_demangle::QualType, llvm::itanium_demangle::VendorExtQualType, llvm::itanium_demangle::DotSuffix, and llvm::itanium_demangle::NodeArrayNode.

Referenced by print(), llvm::itanium_demangle::QualType::printLeft(), llvm::itanium_demangle::AbiTagAttr::printLeft(), llvm::itanium_demangle::PointerToMemberType::printLeft(), llvm::itanium_demangle::ParameterPack::printLeft(), llvm::itanium_demangle::ForwardTemplateReference::printLeft(), llvm::itanium_demangle::DtorName::printLeft(), and llvm::itanium_demangle::CastExpr::printLeft().

◆ printRight()

virtual void llvm::itanium_demangle::Node::printRight ( OutputStream ) const
inlinevirtual

◆ visit()

template<typename Fn >
void llvm::itanium_demangle::Node::visit ( Fn  F) const

Visit the most-derived object corresponding to this object.

Visit the node.

Calls F(P), where P is the node cast to the appropriate derived class.

Definition at line 1997 of file ItaniumDemangle.h.

References assert(), CASE, and FOR_EACH_NODE_KIND.

Referenced by Node(), and llvm::itanium_demangle::parse_discriminator().

Member Data Documentation

◆ ArrayCache

Cache llvm::itanium_demangle::Node::ArrayCache

Track if this node is a (possibly qualified) array type.

This can affect how we format the output string.

Definition at line 125 of file ItaniumDemangle.h.

Referenced by llvm::itanium_demangle::ParameterPack::ParameterPack().

◆ FunctionCache

Cache llvm::itanium_demangle::Node::FunctionCache

Track if this node is a (possibly qualified) function type.

This can affect how we format the output string.

Definition at line 129 of file ItaniumDemangle.h.

Referenced by llvm::itanium_demangle::ParameterPack::ParameterPack().

◆ RHSComponentCache

Cache llvm::itanium_demangle::Node::RHSComponentCache

Tracks if this node has a component on its right side, in which case we need to call printRight.

Definition at line 121 of file ItaniumDemangle.h.

Referenced by llvm::itanium_demangle::ParameterPack::ParameterPack().


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