LLVM 19.0.0git
Classes | Functions
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 <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 isMemberPointer (std::string_view MangledName, bool &Error)
 
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/2]

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

◆ consumeFront() [2/2]

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

Definition at line 49 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C.

◆ consumeSpecialIntrinsicKind()

static SpecialIntrinsicKind consumeSpecialIntrinsicKind ( std::string_view &  MangledName)
static

Definition at line 122 of file MicrosoftDemangle.cpp.

References consumeFront().

◆ countEmbeddedNulls()

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

Definition at line 1233 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 1222 of file MicrosoftDemangle.cpp.

References End, and llvm::Length.

Referenced by guessCharByteSize().

◆ decodeMultiByteChar()

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

◆ demangleFunctionRefQualifier()

static FunctionRefQualifier demangleFunctionRefQualifier ( std::string_view &  MangledName)
static

Definition at line 233 of file MicrosoftDemangle.cpp.

References consumeFront().

◆ demanglePointerCVQualifiers()

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

◆ guessCharByteSize()

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

Definition at line 1246 of file MicrosoftDemangle.cpp.

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

◆ isArrayType()

static bool isArrayType ( std::string_view  S)
static

Definition at line 225 of file MicrosoftDemangle.cpp.

◆ isCustomType()

static bool isCustomType ( std::string_view  S)
static

Definition at line 208 of file MicrosoftDemangle.cpp.

◆ isFunctionType()

static bool isFunctionType ( std::string_view  S)
static

Definition at line 227 of file MicrosoftDemangle.cpp.

◆ isMemberPointer()

static bool isMemberPointer ( std::string_view  MangledName,
bool Error 
)
static

Definition at line 56 of file MicrosoftDemangle.cpp.

References consumeFront(), DEMANGLE_UNREACHABLE, F, and startsWithDigit().

◆ isPointerType()

static bool isPointerType ( std::string_view  S)
static

Definition at line 210 of file MicrosoftDemangle.cpp.

◆ isRebasedHexDigit()

static bool isRebasedHexDigit ( char  C)
static

Definition at line 1061 of file MicrosoftDemangle.cpp.

References llvm::CallingConv::C.

Referenced by rebasedHexDigitToNumber().

◆ isTagType()

static bool isTagType ( std::string_view  S)
static

Definition at line 197 of file MicrosoftDemangle.cpp.

◆ nodeListToNodeArray()

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

◆ outputEscapedChar()

static void outputEscapedChar ( OutputBuffer OB,
unsigned  C 
)
static

Definition at line 1174 of file MicrosoftDemangle.cpp.

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

◆ outputHex()

static void outputHex ( OutputBuffer OB,
unsigned  C 
)
static

Definition at line 1148 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 1063 of file MicrosoftDemangle.cpp.

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

◆ startsWithDigit()

static bool startsWithDigit ( std::string_view  S)
static

Definition at line 33 of file MicrosoftDemangle.cpp.

Referenced by isMemberPointer().

◆ startsWithLocalScopePattern()

static bool startsWithLocalScopePattern ( std::string_view  S)
static

Definition at line 158 of file MicrosoftDemangle.cpp.

References consumeFront(), and End.

◆ synthesizeNamedIdentifier()

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

Definition at line 342 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,
std::string_view  Name 
)
static

◆ synthesizeVariable()

static VariableSymbolNode * synthesizeVariable ( ArenaAllocator Arena,
TypeNode Type,
std::string_view  VariableName 
)
static

◆ writeHexDigit()

static void writeHexDigit ( char Buffer,
uint8_t  Digit 
)
static

Definition at line 1143 of file MicrosoftDemangle.cpp.

References assert().

Referenced by outputHex().