LLVM 19.0.0git
Public Member Functions | Public Attributes | List of all members
ForwardTemplateReference Struct Reference

A forward-reference to a template argument that was not known at the point where the template parameter name was parsed in a mangling. More...

#include "llvm/Demangle/ItaniumDemangle.h"

Inheritance diagram for ForwardTemplateReference:
Inheritance graph
[legend]

Public Member Functions

 ForwardTemplateReference (size_t Index_)
 
template<typename Fn >
void match (Fn F) const =delete
 
bool hasRHSComponentSlow (OutputBuffer &OB) const override
 
bool hasArraySlow (OutputBuffer &OB) const override
 
bool hasFunctionSlow (OutputBuffer &OB) const override
 
const NodegetSyntaxNode (OutputBuffer &OB) const override
 
void printLeft (OutputBuffer &OB) const override
 
void printRight (OutputBuffer &OB) const override
 
- Public Member Functions inherited from Node
 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

size_t Index
 
NodeRef = nullptr
 
bool Printing = false
 
- Public Attributes inherited from Node
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.
 

Additional Inherited Members

- Public Types inherited from Node
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...
 

Detailed Description

A forward-reference to a template argument that was not known at the point where the template parameter name was parsed in a mangling.

This is created when demangling the name of a specialization of a conversion function template:

struct A {
template<typename T> operator T*();
};
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

When demangling a specialization of the conversion function template, we encounter the name of the template (including the T) before we reach the template argument list, so we cannot substitute the parameter name for the corresponding argument while parsing. Instead, we create a ForwardTemplateReference node that is resolved after we parse the template arguments.

Definition at line 1541 of file ItaniumDemangle.h.

Constructor & Destructor Documentation

◆ ForwardTemplateReference()

ForwardTemplateReference::ForwardTemplateReference ( size_t  Index_)
inline

Definition at line 1551 of file ItaniumDemangle.h.

Member Function Documentation

◆ getSyntaxNode()

const Node * ForwardTemplateReference::getSyntaxNode ( OutputBuffer OB) const
inlineoverridevirtual

Reimplemented from Node.

Definition at line 1579 of file ItaniumDemangle.h.

References Node::getSyntaxNode(), Printing, and Ref.

◆ hasArraySlow()

bool ForwardTemplateReference::hasArraySlow ( OutputBuffer OB) const
inlineoverridevirtual

Reimplemented from Node.

Definition at line 1567 of file ItaniumDemangle.h.

References Node::hasArray(), Printing, and Ref.

◆ hasFunctionSlow()

bool ForwardTemplateReference::hasFunctionSlow ( OutputBuffer OB) const
inlineoverridevirtual

Reimplemented from Node.

Definition at line 1573 of file ItaniumDemangle.h.

References Node::hasFunction(), Printing, and Ref.

◆ hasRHSComponentSlow()

bool ForwardTemplateReference::hasRHSComponentSlow ( OutputBuffer OB) const
inlineoverridevirtual

Reimplemented from Node.

Definition at line 1561 of file ItaniumDemangle.h.

References Node::hasRHSComponent(), Printing, and Ref.

◆ match()

template<typename Fn >
void ForwardTemplateReference::match ( Fn  F) const
delete

◆ printLeft()

void ForwardTemplateReference::printLeft ( OutputBuffer OB) const
inlineoverridevirtual

Implements Node.

Definition at line 1586 of file ItaniumDemangle.h.

References Printing, Node::printLeft(), and Ref.

◆ printRight()

void ForwardTemplateReference::printRight ( OutputBuffer OB) const
inlineoverridevirtual

Reimplemented from Node.

Definition at line 1592 of file ItaniumDemangle.h.

References Printing, Node::printRight(), and Ref.

Member Data Documentation

◆ Index

size_t ForwardTemplateReference::Index

Definition at line 1542 of file ItaniumDemangle.h.

◆ Printing

bool ForwardTemplateReference::Printing = false
mutable

◆ Ref

Node* ForwardTemplateReference::Ref = nullptr

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