LLVM 22.0.0git
Node Class Referenceabstract

#include "llvm/Demangle/ItaniumDemangle.h"

Inherited by FloatLiteralImpl< float >, FloatLiteralImpl< double >, FloatLiteralImpl< long double >, AbiTagAttr, ArraySubscriptExpr, ArrayType, BinaryExpr, BinaryFPType, BitIntType, BoolExpr, BracedExpr, BracedRangeExpr, CallExpr, CastExpr, ClosureTypeName, ConditionalExpr, ConstrainedTypeTemplateParamDecl, ConversionExpr, ConversionOperatorType, CtorDtorName, CtorVtableSpecialName, DeleteExpr, DotSuffix, DtorName, DynamicExceptionSpec, ElaboratedTypeSpefType, EnableIfAttr, EnclosingExpr, EnumLiteral, ExpandedSpecialSubstitution, ExplicitObjectParameter, ExprRequirement, FloatLiteralImpl< Float >, FoldExpr, ForwardTemplateReference, FunctionEncoding, FunctionParam, FunctionType, GlobalQualifiedName, InitListExpr, IntegerLiteral, LambdaExpr, LiteralOperator, LocalName, MemberExpr, MemberLikeFriendName, ModuleEntity, ModuleName, NameType, NameWithTemplateArgs, NestedName, NestedRequirement, NewExpr, NodeArrayNode, NoexceptSpec, NonTypeTemplateParamDecl, ObjCProtoName, ParameterPack, ParameterPackExpansion, PixelVectorType, PointerToMemberConversionExpr, PointerToMemberType, PointerType, PostfixExpr, PostfixQualifiedType, PrefixExpr, QualType, QualifiedName, ReferenceType, RequiresExpr, SizeofParamPackExpr, SpecialName, StringLiteral, StructuredBindingName, SubobjectExpr, SyntheticTemplateParamName, TemplateArgs, TemplateArgumentPack, TemplateParamPackDecl, TemplateParamQualifiedArg, TemplateTemplateParamDecl, ThrowExpr, TransformedType, TypeRequirement, TypeTemplateParamDecl, UnnamedTypeName, VectorType, and VendorExtQualType.

Public Types

enum  Kind : uint8_t
enum class  Cache : uint8_t { Yes , No , Unknown }
 Three-way bool to track a cached value. More...
enum class  Prec : uint8_t {
  Primary , Postfix , Unary , Cast ,
  PtrMem , Multiplicative , Additive , Shift ,
  Spaceship , Relational , Equality , And ,
  Xor , Ior , AndIf , OrIf ,
  Conditional , Assign , Comma , Default
}
 Operator precedence for expression nodes. More...

Public Member Functions

 Node (Kind K_, Prec Precedence_=Prec::Primary, Cache RHSComponentCache_=Cache::No, Cache ArrayCache_=Cache::No, Cache FunctionCache_=Cache::No)
 Node (Kind K_, Cache RHSComponentCache_, 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.
bool hasRHSComponent (OutputBuffer &OB) const
bool hasArray (OutputBuffer &OB) const
bool hasFunction (OutputBuffer &OB) const
Kind getKind () const
Prec getPrecedence () const
Cache getRHSComponentCache () const
Cache getArrayCache () const
Cache getFunctionCache () const
virtual bool hasRHSComponentSlow (OutputBuffer &) const
virtual bool hasArraySlow (OutputBuffer &) const
virtual bool hasFunctionSlow (OutputBuffer &) const
virtual const NodegetSyntaxNode (OutputBuffer &) const
void printAsOperand (OutputBuffer &OB, Prec P=Prec::Default, bool StrictlyWorse=false) const
void print (OutputBuffer &OB) const
virtual bool printInitListAsType (OutputBuffer &, const NodeArray &) const
virtual std::string_view getBaseName () const
virtual ~Node ()=default
DEMANGLE_DUMP_METHOD void dump () const

Protected Attributes

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

Friends

class OutputBuffer

Detailed Description

Definition at line 166 of file ItaniumDemangle.h.

Member Enumeration Documentation

◆ Cache

enum class Node::Cache : uint8_t
strong

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 175 of file ItaniumDemangle.h.

◆ Kind

Definition at line 168 of file ItaniumDemangle.h.

◆ Prec

enum class Node::Prec : uint8_t
strong

Operator precedence for expression nodes.

Used to determine required parens in expression emission.

Enumerator
Primary 
Postfix 
Unary 
Cast 
PtrMem 
Multiplicative 
Additive 
Shift 
Spaceship 
Relational 
Equality 
And 
Xor 
Ior 
AndIf 
OrIf 
Conditional 
Assign 
Comma 
Default 

Definition at line 179 of file ItaniumDemangle.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

Node::Node ( Kind K_,
Prec Precedence_ = Prec::Primary,
Cache RHSComponentCache_ = Cache::No,
Cache ArrayCache_ = Cache::No,
Cache FunctionCache_ = Cache::No )
inline

Definition at line 221 of file ItaniumDemangle.h.

References ArrayCache, FunctionCache, No, Primary, and RHSComponentCache.

Referenced by AbiTagAttr::AbiTagAttr(), ArraySubscriptExpr::ArraySubscriptExpr(), ArrayType::ArrayType(), BinaryExpr::BinaryExpr(), BinaryFPType::BinaryFPType(), BitIntType::BitIntType(), BoolExpr::BoolExpr(), BracedExpr::BracedExpr(), BracedRangeExpr::BracedRangeExpr(), CallExpr::CallExpr(), CastExpr::CastExpr(), ClosureTypeName::ClosureTypeName(), ConditionalExpr::ConditionalExpr(), ConstrainedTypeTemplateParamDecl::ConstrainedTypeTemplateParamDecl(), ConversionExpr::ConversionExpr(), ConversionOperatorType::ConversionOperatorType(), CtorDtorName::CtorDtorName(), CtorVtableSpecialName::CtorVtableSpecialName(), DeleteExpr::DeleteExpr(), DotSuffix::DotSuffix(), DtorName::DtorName(), DynamicExceptionSpec::DynamicExceptionSpec(), ElaboratedTypeSpefType::ElaboratedTypeSpefType(), EnableIfAttr::EnableIfAttr(), EnclosingExpr::EnclosingExpr(), EnumLiteral::EnumLiteral(), ExpandedSpecialSubstitution::ExpandedSpecialSubstitution(), ExplicitObjectParameter::ExplicitObjectParameter(), ExprRequirement::ExprRequirement(), FloatLiteralImpl< float >::FloatLiteralImpl(), FoldExpr::FoldExpr(), ForwardTemplateReference::ForwardTemplateReference(), FunctionEncoding::FunctionEncoding(), FunctionParam::FunctionParam(), FunctionType::FunctionType(), TemplateParamQualifiedArg::getArg(), FunctionEncoding::getAttrs(), VectorType::getBaseType(), ParameterPackExpansion::getChild(), QualType::getChild(), VectorType::getDimension(), FunctionEncoding::getName(), PointerType::getPointee(), FunctionEncoding::getRequires(), FunctionEncoding::getReturnType(), ForwardTemplateReference::getSyntaxNode(), getSyntaxNode(), ParameterPack::getSyntaxNode(), VendorExtQualType::getTA(), VendorExtQualType::getTy(), GlobalQualifiedName::GlobalQualifiedName(), InitListExpr::InitListExpr(), IntegerLiteral::IntegerLiteral(), LambdaExpr::LambdaExpr(), LiteralOperator::LiteralOperator(), LocalName::LocalName(), MemberExpr::MemberExpr(), MemberLikeFriendName::MemberLikeFriendName(), ModuleEntity::ModuleEntity(), ModuleName::ModuleName(), NameType::NameType(), NameWithTemplateArgs::NameWithTemplateArgs(), NestedName::NestedName(), NestedRequirement::NestedRequirement(), NewExpr::NewExpr(), Node(), NodeArrayNode::NodeArrayNode(), NoexceptSpec::NoexceptSpec(), NonTypeTemplateParamDecl::NonTypeTemplateParamDecl(), ObjCProtoName::ObjCProtoName(), ParameterPack::ParameterPack(), ParameterPackExpansion::ParameterPackExpansion(), PixelVectorType::PixelVectorType(), PointerToMemberConversionExpr::PointerToMemberConversionExpr(), PointerToMemberType::PointerToMemberType(), PointerType::PointerType(), PostfixExpr::PostfixExpr(), PostfixQualifiedType::PostfixQualifiedType(), PrefixExpr::PrefixExpr(), RequiresExpr::printLeft(), QualifiedName::QualifiedName(), QualType::QualType(), ReferenceType::ReferenceType(), RequiresExpr::RequiresExpr(), SizeofParamPackExpr::SizeofParamPackExpr(), SpecialName::SpecialName(), StringLiteral::StringLiteral(), StructuredBindingName::StructuredBindingName(), SubobjectExpr::SubobjectExpr(), SyntheticTemplateParamName::SyntheticTemplateParamName(), TemplateArgs::TemplateArgs(), TemplateArgumentPack::TemplateArgumentPack(), TemplateParamPackDecl::TemplateParamPackDecl(), TemplateParamQualifiedArg::TemplateParamQualifiedArg(), TemplateTemplateParamDecl::TemplateTemplateParamDecl(), ThrowExpr::ThrowExpr(), TransformedType::TransformedType(), TypeRequirement::TypeRequirement(), TypeTemplateParamDecl::TypeTemplateParamDecl(), UnnamedTypeName::UnnamedTypeName(), VectorType::VectorType(), and VendorExtQualType::VendorExtQualType().

◆ Node() [2/2]

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

Definition at line 226 of file ItaniumDemangle.h.

References No, Node(), and Primary.

◆ ~Node()

virtual Node::~Node ( )
virtualdefault

Member Function Documentation

◆ dump()

◆ getArrayCache()

Cache Node::getArrayCache ( ) const
inline

Definition at line 262 of file ItaniumDemangle.h.

References ArrayCache.

Referenced by AbiTagAttr::AbiTagAttr(), and QualType::QualType().

◆ getBaseName()

virtual std::string_view Node::getBaseName ( ) const
inlinevirtual

◆ getFunctionCache()

Cache Node::getFunctionCache ( ) const
inline

Definition at line 263 of file ItaniumDemangle.h.

References FunctionCache.

Referenced by AbiTagAttr::AbiTagAttr(), and QualType::QualType().

◆ getKind()

◆ getPrecedence()

◆ getRHSComponentCache()

◆ getSyntaxNode()

virtual const Node * Node::getSyntaxNode ( OutputBuffer & ) const
inlinevirtual

Reimplemented in ForwardTemplateReference, and ParameterPack.

Definition at line 271 of file ItaniumDemangle.h.

References Node(), and OutputBuffer.

◆ hasArray()

bool Node::hasArray ( OutputBuffer & OB) const
inline

Definition at line 246 of file ItaniumDemangle.h.

References ArrayCache, hasArraySlow(), OutputBuffer, Unknown, and Yes.

◆ hasArraySlow()

virtual bool Node::hasArraySlow ( OutputBuffer & ) const
inlinevirtual

Reimplemented in ArrayType, ForwardTemplateReference, ParameterPack, and QualType.

Definition at line 266 of file ItaniumDemangle.h.

References OutputBuffer.

Referenced by hasArray().

◆ hasFunction()

bool Node::hasFunction ( OutputBuffer & OB) const
inline

Definition at line 252 of file ItaniumDemangle.h.

References FunctionCache, hasFunctionSlow(), OutputBuffer, Unknown, and Yes.

◆ hasFunctionSlow()

virtual bool Node::hasFunctionSlow ( OutputBuffer & ) const
inlinevirtual

Reimplemented in ForwardTemplateReference, FunctionEncoding, FunctionType, ParameterPack, and QualType.

Definition at line 267 of file ItaniumDemangle.h.

References OutputBuffer.

Referenced by hasFunction().

◆ hasRHSComponent()

bool Node::hasRHSComponent ( OutputBuffer & OB) const
inline

Definition at line 240 of file ItaniumDemangle.h.

References hasRHSComponentSlow(), OutputBuffer, RHSComponentCache, Unknown, and Yes.

◆ hasRHSComponentSlow()

virtual bool Node::hasRHSComponentSlow ( OutputBuffer & ) const
inlinevirtual

◆ print()

◆ printAsOperand()

void Node::printAsOperand ( OutputBuffer & OB,
Prec P = Prec::Default,
bool StrictlyWorse = false ) const
inline

◆ printInitListAsType()

virtual bool Node::printInitListAsType ( OutputBuffer & ,
const NodeArray &  ) const
inlinevirtual

Reimplemented in ArrayType.

Definition at line 295 of file ItaniumDemangle.h.

References OutputBuffer.

◆ visit()

template<typename Fn>
void 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 2637 of file ItaniumDemangle.h.

References DEMANGLE_ASSERT, and F.

◆ OutputBuffer

friend class OutputBuffer
friend

Definition at line 309 of file ItaniumDemangle.h.

References OutputBuffer.

Referenced by ForwardTemplateReference::getSyntaxNode(), getSyntaxNode(), ParameterPack::getSyntaxNode(), hasArray(), ArrayType::hasArraySlow(), ForwardTemplateReference::hasArraySlow(), hasArraySlow(), ParameterPack::hasArraySlow(), QualType::hasArraySlow(), hasFunction(), ForwardTemplateReference::hasFunctionSlow(), FunctionEncoding::hasFunctionSlow(), FunctionType::hasFunctionSlow(), hasFunctionSlow(), ParameterPack::hasFunctionSlow(), QualType::hasFunctionSlow(), hasRHSComponent(), ArrayType::hasRHSComponentSlow(), ForwardTemplateReference::hasRHSComponentSlow(), FunctionEncoding::hasRHSComponentSlow(), FunctionType::hasRHSComponentSlow(), hasRHSComponentSlow(), ParameterPack::hasRHSComponentSlow(), PointerToMemberType::hasRHSComponentSlow(), PointerType::hasRHSComponentSlow(), QualType::hasRHSComponentSlow(), ReferenceType::hasRHSComponentSlow(), OutputBuffer, print(), printAsOperand(), ClosureTypeName::printDeclarator(), ArrayType::printInitListAsType(), printInitListAsType(), AbiTagAttr::printLeft(), ArraySubscriptExpr::printLeft(), ArrayType::printLeft(), BinaryExpr::printLeft(), BinaryFPType::printLeft(), BitIntType::printLeft(), BoolExpr::printLeft(), BracedExpr::printLeft(), BracedRangeExpr::printLeft(), CallExpr::printLeft(), CastExpr::printLeft(), ClosureTypeName::printLeft(), ConditionalExpr::printLeft(), ConstrainedTypeTemplateParamDecl::printLeft(), ConversionExpr::printLeft(), ConversionOperatorType::printLeft(), CtorDtorName::printLeft(), CtorVtableSpecialName::printLeft(), DeleteExpr::printLeft(), DotSuffix::printLeft(), DtorName::printLeft(), DynamicExceptionSpec::printLeft(), ElaboratedTypeSpefType::printLeft(), EnableIfAttr::printLeft(), EnclosingExpr::printLeft(), EnumLiteral::printLeft(), ExplicitObjectParameter::printLeft(), ExprRequirement::printLeft(), FloatLiteralImpl< float >::printLeft(), FoldExpr::printLeft(), ForwardTemplateReference::printLeft(), FunctionEncoding::printLeft(), FunctionParam::printLeft(), FunctionType::printLeft(), GlobalQualifiedName::printLeft(), InitListExpr::printLeft(), IntegerLiteral::printLeft(), LambdaExpr::printLeft(), LiteralOperator::printLeft(), LocalName::printLeft(), MemberExpr::printLeft(), MemberLikeFriendName::printLeft(), ModuleEntity::printLeft(), ModuleName::printLeft(), NameType::printLeft(), NameWithTemplateArgs::printLeft(), NestedName::printLeft(), NestedRequirement::printLeft(), NewExpr::printLeft(), NodeArrayNode::printLeft(), NoexceptSpec::printLeft(), NonTypeTemplateParamDecl::printLeft(), ObjCProtoName::printLeft(), ParameterPack::printLeft(), ParameterPackExpansion::printLeft(), PixelVectorType::printLeft(), PointerToMemberConversionExpr::printLeft(), PointerToMemberType::printLeft(), PointerType::printLeft(), PostfixExpr::printLeft(), PostfixQualifiedType::printLeft(), PrefixExpr::printLeft(), QualifiedName::printLeft(), QualType::printLeft(), ReferenceType::printLeft(), RequiresExpr::printLeft(), SizeofParamPackExpr::printLeft(), SpecialName::printLeft(), SpecialSubstitution::printLeft(), StringLiteral::printLeft(), StructuredBindingName::printLeft(), SubobjectExpr::printLeft(), SyntheticTemplateParamName::printLeft(), TemplateArgs::printLeft(), TemplateArgumentPack::printLeft(), TemplateParamPackDecl::printLeft(), TemplateParamQualifiedArg::printLeft(), TemplateTemplateParamDecl::printLeft(), ThrowExpr::printLeft(), TransformedType::printLeft(), TypeRequirement::printLeft(), TypeTemplateParamDecl::printLeft(), UnnamedTypeName::printLeft(), VectorType::printLeft(), VendorExtQualType::printLeft(), QualType::printQuals(), ArrayType::printRight(), ConstrainedTypeTemplateParamDecl::printRight(), ForwardTemplateReference::printRight(), FunctionEncoding::printRight(), FunctionType::printRight(), NonTypeTemplateParamDecl::printRight(), ParameterPack::printRight(), PointerToMemberType::printRight(), PointerType::printRight(), QualType::printRight(), ReferenceType::printRight(), TemplateParamPackDecl::printRight(), TemplateTemplateParamDecl::printRight(), and TypeTemplateParamDecl::printRight().

Member Data Documentation

◆ ArrayCache

Cache Node::ArrayCache
protected

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

This can affect how we format the output string.

Definition at line 214 of file ItaniumDemangle.h.

Referenced by getArrayCache(), hasArray(), Node(), and ParameterPack::ParameterPack().

◆ FunctionCache

Cache Node::FunctionCache
protected

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

This can affect how we format the output string.

Definition at line 218 of file ItaniumDemangle.h.

Referenced by getFunctionCache(), hasFunction(), Node(), and ParameterPack::ParameterPack().

◆ RHSComponentCache

Cache Node::RHSComponentCache
protected

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

Definition at line 210 of file ItaniumDemangle.h.

Referenced by getRHSComponentCache(), hasRHSComponent(), Node(), ParameterPack::ParameterPack(), and print().


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