LLVM 22.0.0git
Public Member Functions | List of all members
llvm::ItaniumPartialDemangler Struct Reference

"Partial" demangler. More...

#include "llvm/Demangle/Demangle.h"

Public Member Functions

DEMANGLE_ABI ItaniumPartialDemangler ()
 
DEMANGLE_ABI ItaniumPartialDemangler (ItaniumPartialDemangler &&Other)
 
DEMANGLE_ABI ItaniumPartialDemangleroperator= (ItaniumPartialDemangler &&Other)
 
DEMANGLE_ABI bool partialDemangle (const char *MangledName)
 Demangle into an AST.
 
DEMANGLE_ABI charfinishDemangle (char *Buf, size_t *N) const
 Just print the entire mangled name into Buf.
 
DEMANGLE_ABI charfinishDemangle (void *OB) const
 See finishDemangle.
 
DEMANGLE_ABI chargetFunctionBaseName (char *Buf, size_t *N) const
 Get the base name of a function.
 
DEMANGLE_ABI chargetFunctionDeclContextName (char *Buf, size_t *N) const
 Get the context name for a function.
 
DEMANGLE_ABI chargetFunctionName (char *Buf, size_t *N) const
 Get the entire name of this function.
 
DEMANGLE_ABI chargetFunctionParameters (char *Buf, size_t *N) const
 Get the parameters for this function.
 
DEMANGLE_ABI chargetFunctionReturnType (char *Buf, size_t *N) const
 
DEMANGLE_ABI bool hasFunctionQualifiers () const
 If this function has any cv or reference qualifiers.
 
DEMANGLE_ABI bool isCtorOrDtor () const
 If this symbol describes a constructor or destructor.
 
DEMANGLE_ABI bool isFunction () const
 If this symbol describes a function.
 
DEMANGLE_ABI bool isData () const
 If this symbol describes a variable.
 
DEMANGLE_ABI bool isSpecialName () const
 If this symbol is a <special-name>.
 
DEMANGLE_ABI ~ItaniumPartialDemangler ()
 

Detailed Description

"Partial" demangler.

This supports demangling a string into an AST (typically an intermediate stage in itaniumDemangle) and querying certain properties or partially printing the demangled name.

Definition at line 85 of file Demangle.h.

Constructor & Destructor Documentation

◆ ItaniumPartialDemangler() [1/2]

ItaniumPartialDemangler::ItaniumPartialDemangler ( )

Definition at line 386 of file ItaniumDemangle.cpp.

References Context.

◆ ItaniumPartialDemangler() [2/2]

ItaniumPartialDemangler::ItaniumPartialDemangler ( ItaniumPartialDemangler &&  Other)

Definition at line 393 of file ItaniumDemangle.cpp.

References Context, and llvm::Other.

◆ ~ItaniumPartialDemangler()

ItaniumPartialDemangler::~ItaniumPartialDemangler ( )

Definition at line 389 of file ItaniumDemangle.cpp.

Member Function Documentation

◆ finishDemangle() [1/2]

char * ItaniumPartialDemangler::finishDemangle ( char Buf,
size_t *  N 
) const

Just print the entire mangled name into Buf.

Buf and N behave like the second and third parameters to __cxa_demangle.

Definition at line 541 of file ItaniumDemangle.cpp.

References assert(), N, and printNode().

◆ finishDemangle() [2/2]

char * ItaniumPartialDemangler::finishDemangle ( void *  OB) const

See finishDemangle.

Parameters
[in]OBA llvm::itanium_demangle::OutputBuffer that the demangled name will be printed into.

Definition at line 546 of file ItaniumDemangle.cpp.

References assert(), and printNode().

◆ getFunctionBaseName()

char * ItaniumPartialDemangler::getFunctionBaseName ( char Buf,
size_t *  N 
) const

Get the base name of a function.

This doesn't include trailing template arguments, ie for "a::b<int>" this function returns "b".

Definition at line 427 of file ItaniumDemangle.cpp.

References llvm::sampleprof::Base, getName(), isFunction(), N, Name, and printNode().

◆ getFunctionDeclContextName()

char * ItaniumPartialDemangler::getFunctionDeclContextName ( char Buf,
size_t *  N 
) const

Get the context name for a function.

For "a::b::c", this function returns "a::b".

Definition at line 456 of file ItaniumDemangle.cpp.

References llvm::sampleprof::Base, LocalName::Encoding, getName(), isFunction(), N, ModuleEntity::Name, Name, and Node::print().

◆ getFunctionName()

char * ItaniumPartialDemangler::getFunctionName ( char Buf,
size_t *  N 
) const

Get the entire name of this function.

Definition at line 500 of file ItaniumDemangle.cpp.

References getName(), isFunction(), N, Name, and printNode().

◆ getFunctionParameters()

char * ItaniumPartialDemangler::getFunctionParameters ( char Buf,
size_t *  N 
) const

Get the parameters for this function.

Definition at line 507 of file ItaniumDemangle.cpp.

References isFunction(), N, and NodeArray::printWithComma().

◆ getFunctionReturnType()

char * ItaniumPartialDemangler::getFunctionReturnType ( char Buf,
size_t *  N 
) const

Definition at line 524 of file ItaniumDemangle.cpp.

References isFunction(), and N.

◆ hasFunctionQualifiers()

bool ItaniumPartialDemangler::hasFunctionQualifiers ( ) const

If this function has any cv or reference qualifiers.

These imply that the function is a non-static member function.

Definition at line 554 of file ItaniumDemangle.cpp.

References assert(), FrefQualNone, FunctionEncoding::getCVQuals(), isFunction(), and QualNone.

◆ isCtorOrDtor()

bool ItaniumPartialDemangler::isCtorOrDtor ( ) const

If this symbol describes a constructor or destructor.

Definition at line 562 of file ItaniumDemangle.cpp.

References llvm::sampleprof::Base, getName(), N, and Name.

◆ isData()

bool ItaniumPartialDemangler::isData ( ) const

If this symbol describes a variable.

Definition at line 606 of file ItaniumDemangle.cpp.

References isFunction(), and isSpecialName().

◆ isFunction()

bool ItaniumPartialDemangler::isFunction ( ) const

◆ isSpecialName()

bool ItaniumPartialDemangler::isSpecialName ( ) const

If this symbol is a <special-name>.

These are generally implicitly generated by the implementation, such as vtables and typeinfo names.

Definition at line 600 of file ItaniumDemangle.cpp.

References assert().

Referenced by isData().

◆ operator=()

ItaniumPartialDemangler & ItaniumPartialDemangler::operator= ( ItaniumPartialDemangler &&  Other)

Definition at line 399 of file ItaniumDemangle.cpp.

References llvm::Other, and std::swap().

◆ partialDemangle()

bool ItaniumPartialDemangler::partialDemangle ( const char MangledName)

Demangle into an AST.

Subsequent calls to the rest of the member functions implicitly operate on the AST this produces.

Returns
true on error, false otherwise

Definition at line 407 of file ItaniumDemangle.cpp.


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