Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
MicrosoftDemangle.cpp File Reference
#include "llvm/Demangle/MicrosoftDemangle.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Demangle/DemangleConfig.h"
#include "llvm/Demangle/MicrosoftDemangleNodes.h"
#include "llvm/Demangle/StringViewExtras.h"
#include "llvm/Demangle/Utility.h"
#include <array>
#include <cctype>
#include <cstdio>
#include <optional>
#include <string_view>
#include <tuple>

Go to the source code of this file.

Classes

struct  NodeList

Functions

static bool startsWithDigit (std::string_view S)
static bool consumeFront (std::string_view &S, char C)
static bool consumeFront (std::string_view &S, std::string_view C)
static bool consumeFront (std::string_view &S, std::string_view PrefixA, std::string_view PrefixB, bool A)
static bool startsWith (std::string_view S, std::string_view PrefixA, std::string_view PrefixB, bool A)
static SpecialIntrinsicKind consumeSpecialIntrinsicKind (std::string_view &MangledName)
static bool startsWithLocalScopePattern (std::string_view S)
static bool isTagType (std::string_view S)
static bool isCustomType (std::string_view S)
static bool isPointerType (std::string_view S)
static bool isArrayType (std::string_view S)
static bool isFunctionType (std::string_view S)
static FunctionRefQualifier demangleFunctionRefQualifier (std::string_view &MangledName)
static std::pair< Qualifiers, PointerAffinitydemanglePointerCVQualifiers (std::string_view &MangledName)
static NamedIdentifierNodesynthesizeNamedIdentifier (ArenaAllocator &Arena, std::string_view Name)
static QualifiedNameNodesynthesizeQualifiedName (ArenaAllocator &Arena, IdentifierNode *Identifier)
static QualifiedNameNodesynthesizeQualifiedName (ArenaAllocator &Arena, std::string_view Name)
static VariableSymbolNodesynthesizeVariable (ArenaAllocator &Arena, TypeNode *Type, std::string_view 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

◆ consumeFront() [1/3]

◆ consumeFront() [2/3]

bool consumeFront ( std::string_view & S,
std::string_view C )
static

Definition at line 50 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C.

◆ consumeFront() [3/3]

bool consumeFront ( std::string_view & S,
std::string_view PrefixA,
std::string_view PrefixB,
bool A )
static

Definition at line 57 of file MicrosoftDemangle.cpp.

References A(), and consumeFront().

◆ consumeSpecialIntrinsicKind()

◆ countEmbeddedNulls()

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

Definition at line 1247 of file MicrosoftDemangle.cpp.

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

Referenced by guessCharByteSize().

◆ countTrailingNullBytes()

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

Definition at line 1236 of file MicrosoftDemangle.cpp.

References llvm::Count, and llvm::Length.

Referenced by guessCharByteSize().

◆ decodeMultiByteChar()

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

◆ demangleFunctionRefQualifier()

FunctionRefQualifier demangleFunctionRefQualifier ( std::string_view & MangledName)
static

◆ demanglePointerCVQualifiers()

◆ guessCharByteSize()

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

Definition at line 1260 of file MicrosoftDemangle.cpp.

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

◆ isArrayType()

bool isArrayType ( std::string_view S)
static

Definition at line 239 of file MicrosoftDemangle.cpp.

◆ isCustomType()

bool isCustomType ( std::string_view S)
static

Definition at line 222 of file MicrosoftDemangle.cpp.

◆ isFunctionType()

bool isFunctionType ( std::string_view S)
static

Definition at line 241 of file MicrosoftDemangle.cpp.

◆ isPointerType()

bool isPointerType ( std::string_view S)
static

Definition at line 224 of file MicrosoftDemangle.cpp.

◆ isRebasedHexDigit()

bool isRebasedHexDigit ( char C)
static

Definition at line 1075 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C.

Referenced by rebasedHexDigitToNumber().

◆ isTagType()

bool isTagType ( std::string_view S)
static

Definition at line 211 of file MicrosoftDemangle.cpp.

◆ nodeListToNodeArray()

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

◆ outputEscapedChar()

void outputEscapedChar ( OutputBuffer & OB,
unsigned C )
static

Definition at line 1188 of file MicrosoftDemangle.cpp.

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

◆ outputHex()

void outputHex ( OutputBuffer & OB,
unsigned C )
static

Definition at line 1162 of file MicrosoftDemangle.cpp.

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

Referenced by outputEscapedChar().

◆ rebasedHexDigitToNumber()

uint8_t rebasedHexDigitToNumber ( char C)
static

Definition at line 1077 of file MicrosoftDemangle.cpp.

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

◆ startsWith()

bool startsWith ( std::string_view S,
std::string_view PrefixA,
std::string_view PrefixB,
bool A )
static

Definition at line 63 of file MicrosoftDemangle.cpp.

References A().

◆ startsWithDigit()

bool startsWithDigit ( std::string_view S)
static

Definition at line 34 of file MicrosoftDemangle.cpp.

◆ startsWithLocalScopePattern()

bool startsWithLocalScopePattern ( std::string_view S)
static

Definition at line 172 of file MicrosoftDemangle.cpp.

References consumeFront().

◆ synthesizeNamedIdentifier()

NamedIdentifierNode * synthesizeNamedIdentifier ( ArenaAllocator & Arena,
std::string_view Name )
static

◆ synthesizeQualifiedName() [1/2]

◆ synthesizeQualifiedName() [2/2]

QualifiedNameNode * synthesizeQualifiedName ( ArenaAllocator & Arena,
std::string_view Name )
static

◆ synthesizeVariable()

◆ writeHexDigit()

void writeHexDigit ( char * Buffer,
uint8_t Digit )
static

Definition at line 1157 of file MicrosoftDemangle.cpp.

References assert().

Referenced by outputHex().