LLVM 17.0.0git
Classes | Functions
MicrosoftDemangle.cpp File Reference
#include "llvm/Demangle/MicrosoftDemangle.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Demangle/MicrosoftDemangleNodes.h"
#include "llvm/Demangle/DemangleConfig.h"
#include "llvm/Demangle/StringView.h"
#include "llvm/Demangle/Utility.h"
#include <array>
#include <cctype>
#include <cstdio>
#include <tuple>
Include dependency graph for MicrosoftDemangle.cpp:

Go to the source code of this file.

Classes

struct  NodeList
 

Functions

static bool startsWithDigit (StringView S)
 
static bool isMemberPointer (StringView MangledName, bool &Error)
 
static SpecialIntrinsicKind consumeSpecialIntrinsicKind (StringView &MangledName)
 
static bool startsWithLocalScopePattern (StringView S)
 
static bool isTagType (StringView S)
 
static bool isCustomType (StringView S)
 
static bool isPointerType (StringView S)
 
static bool isArrayType (StringView S)
 
static bool isFunctionType (StringView S)
 
static FunctionRefQualifier demangleFunctionRefQualifier (StringView &MangledName)
 
static std::pair< Qualifiers, PointerAffinitydemanglePointerCVQualifiers (StringView &MangledName)
 
static NamedIdentifierNodesynthesizeNamedIdentifier (ArenaAllocator &Arena, StringView Name)
 
static QualifiedNameNodesynthesizeQualifiedName (ArenaAllocator &Arena, IdentifierNode *Identifier)
 
static QualifiedNameNodesynthesizeQualifiedName (ArenaAllocator &Arena, StringView Name)
 
static VariableSymbolNodesynthesizeVariable (ArenaAllocator &Arena, TypeNode *Type, StringView VariableName)
 
static bool isRebasedHexDigit (char C)
 
static uint8_t rebasedHexDigitToNumber (char C)
 
static void writeHexDigit (char *Buffer, uint8_t Digit)
 
static void outputHex (OutputBuffer &OB, unsigned C)
 
static void outputEscapedChar (OutputBuffer &OB, unsigned C)
 
static unsigned countTrailingNullBytes (const uint8_t *StringBytes, int Length)
 
static unsigned countEmbeddedNulls (const uint8_t *StringBytes, unsigned Length)
 
static unsigned guessCharByteSize (const uint8_t *StringBytes, unsigned NumChars, uint64_t NumBytes)
 
static unsigned decodeMultiByteChar (const uint8_t *StringBytes, unsigned CharIndex, unsigned CharBytes)
 
static NodeArrayNodenodeListToNodeArray (ArenaAllocator &Arena, NodeList *Head, size_t Count)
 

Function Documentation

◆ consumeSpecialIntrinsicKind()

static SpecialIntrinsicKind consumeSpecialIntrinsicKind ( StringView MangledName)
static

Definition at line 106 of file MicrosoftDemangle.cpp.

References StringView::consumeFront().

◆ countEmbeddedNulls()

static unsigned countEmbeddedNulls ( const uint8_t *  StringBytes,
unsigned  Length 
)
static

Definition at line 1196 of file MicrosoftDemangle.cpp.

References I, llvm::Length, and llvm::ms_demangle::Result.

Referenced by guessCharByteSize().

◆ countTrailingNullBytes()

static unsigned countTrailingNullBytes ( const uint8_t *  StringBytes,
int  Length 
)
static

Definition at line 1185 of file MicrosoftDemangle.cpp.

References llvm::Length.

Referenced by guessCharByteSize().

◆ decodeMultiByteChar()

static unsigned decodeMultiByteChar ( const uint8_t *  StringBytes,
unsigned  CharIndex,
unsigned  CharBytes 
)
static

◆ demangleFunctionRefQualifier()

static FunctionRefQualifier demangleFunctionRefQualifier ( StringView MangledName)
static

Definition at line 216 of file MicrosoftDemangle.cpp.

References StringView::consumeFront().

◆ demanglePointerCVQualifiers()

static std::pair< Qualifiers, PointerAffinity > demanglePointerCVQualifiers ( StringView MangledName)
static

◆ guessCharByteSize()

static unsigned guessCharByteSize ( const uint8_t *  StringBytes,
unsigned  NumChars,
uint64_t  NumBytes 
)
static

Definition at line 1209 of file MicrosoftDemangle.cpp.

References assert(), countEmbeddedNulls(), and countTrailingNullBytes().

◆ isArrayType()

static bool isArrayType ( StringView  S)
static

Definition at line 209 of file MicrosoftDemangle.cpp.

◆ isCustomType()

static bool isCustomType ( StringView  S)
static

Definition at line 192 of file MicrosoftDemangle.cpp.

◆ isFunctionType()

static bool isFunctionType ( StringView  S)
static

Definition at line 211 of file MicrosoftDemangle.cpp.

References StringView::startsWith().

◆ isMemberPointer()

static bool isMemberPointer ( StringView  MangledName,
bool Error 
)
static

◆ isPointerType()

static bool isPointerType ( StringView  S)
static

Definition at line 194 of file MicrosoftDemangle.cpp.

References StringView::front(), and StringView::startsWith().

◆ isRebasedHexDigit()

static bool isRebasedHexDigit ( char  C)
static

Definition at line 1027 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C.

Referenced by rebasedHexDigitToNumber().

◆ isTagType()

static bool isTagType ( StringView  S)
static

Definition at line 181 of file MicrosoftDemangle.cpp.

References StringView::front().

◆ nodeListToNodeArray()

static NodeArrayNode * nodeListToNodeArray ( ArenaAllocator Arena,
NodeList Head,
size_t  Count 
)
static

◆ outputEscapedChar()

static void outputEscapedChar ( OutputBuffer OB,
unsigned  C 
)
static

Definition at line 1137 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C, and outputHex().

◆ outputHex()

static void outputHex ( OutputBuffer OB,
unsigned  C 
)
static

Definition at line 1111 of file MicrosoftDemangle.cpp.

References assert(), llvm::CallingConv::C, I, and writeHexDigit().

Referenced by outputEscapedChar().

◆ rebasedHexDigitToNumber()

static uint8_t rebasedHexDigitToNumber ( char  C)
static

Definition at line 1029 of file MicrosoftDemangle.cpp.

References assert(), llvm::CallingConv::C, and isRebasedHexDigit().

◆ startsWithDigit()

static bool startsWithDigit ( StringView  S)
static

Definition at line 32 of file MicrosoftDemangle.cpp.

References StringView::empty(), and StringView::front().

Referenced by isMemberPointer().

◆ startsWithLocalScopePattern()

static bool startsWithLocalScopePattern ( StringView  S)
static

◆ synthesizeNamedIdentifier()

static NamedIdentifierNode * synthesizeNamedIdentifier ( ArenaAllocator Arena,
StringView  Name 
)
static

Definition at line 321 of file MicrosoftDemangle.cpp.

References llvm::ms_demangle::ArenaAllocator::alloc(), and Name.

Referenced by synthesizeQualifiedName().

◆ synthesizeQualifiedName() [1/2]

static QualifiedNameNode * synthesizeQualifiedName ( ArenaAllocator Arena,
IdentifierNode Identifier 
)
static

◆ synthesizeQualifiedName() [2/2]

static QualifiedNameNode * synthesizeQualifiedName ( ArenaAllocator Arena,
StringView  Name 
)
static

◆ synthesizeVariable()

static VariableSymbolNode * synthesizeVariable ( ArenaAllocator Arena,
TypeNode Type,
StringView  VariableName 
)
static

◆ writeHexDigit()

static void writeHexDigit ( char Buffer,
uint8_t  Digit 
)
static

Definition at line 1106 of file MicrosoftDemangle.cpp.

References assert().

Referenced by outputHex().