LLVM 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
Node Class Referenceabstract

#include "llvm/Demangle/ItaniumDemangle.h"

Inherited by 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 : unsigned char
 
enum class  Cache : unsigned char { Yes , No , Unknown }
 Three-way bool to track a cached value. More...
 
enum class  Prec {
  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
 
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 void printLeft (OutputBuffer &) const =0
 
virtual void printRight (OutputBuffer &) const
 
virtual std::string_view getBaseName () const
 
virtual ~Node ()=default
 
DEMANGLE_DUMP_METHOD void dump () const
 

Public 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.
 

Detailed Description

Definition at line 161 of file ItaniumDemangle.h.

Member Enumeration Documentation

◆ Cache

enum class Node::Cache : unsigned char
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 170 of file ItaniumDemangle.h.

◆ Kind

Definition at line 163 of file ItaniumDemangle.h.

◆ Prec

enum class Node::Prec
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 174 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 217 of file ItaniumDemangle.h.

◆ Node() [2/2]

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

Definition at line 222 of file ItaniumDemangle.h.

◆ ~Node()

virtual Node::~Node ( )
virtualdefault

Member Function Documentation

◆ dump()

DEMANGLE_DUMP_METHOD void Node::dump ( ) const

◆ getBaseName()

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

◆ getKind()

Kind Node::getKind ( ) const
inline

◆ getPrecedence()

Prec Node::getPrecedence ( ) const
inline

◆ getSyntaxNode()

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

Reimplemented in ParameterPack, and ForwardTemplateReference.

Definition at line 264 of file ItaniumDemangle.h.

Referenced by ForwardTemplateReference::getSyntaxNode().

◆ hasArray()

bool Node::hasArray ( OutputBuffer OB) const
inline

◆ hasArraySlow()

virtual bool Node::hasArraySlow ( OutputBuffer ) const
inlinevirtual

Reimplemented in ArrayType, QualType, ParameterPack, and ForwardTemplateReference.

Definition at line 259 of file ItaniumDemangle.h.

Referenced by hasArray().

◆ hasFunction()

bool Node::hasFunction ( OutputBuffer OB) const
inline

◆ hasFunctionSlow()

virtual bool Node::hasFunctionSlow ( OutputBuffer ) const
inlinevirtual

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

Definition at line 260 of file ItaniumDemangle.h.

Referenced by hasFunction().

◆ hasRHSComponent()

bool Node::hasRHSComponent ( OutputBuffer OB) const
inline

◆ hasRHSComponentSlow()

virtual bool Node::hasRHSComponentSlow ( OutputBuffer ) const
inlinevirtual

◆ print()

void Node::print ( OutputBuffer OB) const
inline

◆ printAsOperand()

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

◆ printLeft()

virtual void Node::printLeft ( OutputBuffer ) const
pure virtual

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

Referenced by print(), QualType::printLeft(), AbiTagAttr::printLeft(), PointerToMemberType::printLeft(), ForwardTemplateReference::printLeft(), and CastExpr::printLeft().

◆ printRight()

virtual void Node::printRight ( OutputBuffer ) const
inlinevirtual

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

References DEMANGLE_ASSERT.

Member Data Documentation

◆ ArrayCache

Cache Node::ArrayCache

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

This can affect how we format the output string.

Definition at line 210 of file ItaniumDemangle.h.

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

◆ FunctionCache

Cache Node::FunctionCache

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

This can affect how we format the output string.

Definition at line 214 of file ItaniumDemangle.h.

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

◆ RHSComponentCache

Cache Node::RHSComponentCache

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

Definition at line 206 of file ItaniumDemangle.h.

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


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