#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>
usingnamespacellvm;
usingnamespacems_demangle;
static bool startsWithDigit(std::string_view S) { … }
struct NodeList { … };
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 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, PointerAffinity>
demanglePointerCVQualifiers(std::string_view &MangledName) { … }
std::string_view Demangler::copyString(std::string_view Borrowed) { … }
SpecialTableSymbolNode *
Demangler::demangleSpecialTableSymbolNode(std::string_view &MangledName,
SpecialIntrinsicKind K) { … }
LocalStaticGuardVariableNode *
Demangler::demangleLocalStaticGuard(std::string_view &MangledName,
bool IsThread) { … }
static NamedIdentifierNode *synthesizeNamedIdentifier(ArenaAllocator &Arena,
std::string_view Name) { … }
static QualifiedNameNode *synthesizeQualifiedName(ArenaAllocator &Arena,
IdentifierNode *Identifier) { … }
static QualifiedNameNode *synthesizeQualifiedName(ArenaAllocator &Arena,
std::string_view Name) { … }
static VariableSymbolNode *synthesizeVariable(ArenaAllocator &Arena,
TypeNode *Type,
std::string_view VariableName) { … }
VariableSymbolNode *
Demangler::demangleUntypedVariable(ArenaAllocator &Arena,
std::string_view &MangledName,
std::string_view VariableName) { … }
VariableSymbolNode *
Demangler::demangleRttiBaseClassDescriptorNode(ArenaAllocator &Arena,
std::string_view &MangledName) { … }
FunctionSymbolNode *
Demangler::demangleInitFiniStub(std::string_view &MangledName,
bool IsDestructor) { … }
SymbolNode *Demangler::demangleSpecialIntrinsic(std::string_view &MangledName) { … }
IdentifierNode *
Demangler::demangleFunctionIdentifierCode(std::string_view &MangledName) { … }
StructorIdentifierNode *
Demangler::demangleStructorIdentifier(std::string_view &MangledName,
bool IsDestructor) { … }
ConversionOperatorIdentifierNode *
Demangler::demangleConversionOperatorIdentifier(std::string_view &MangledName) { … }
LiteralOperatorIdentifierNode *
Demangler::demangleLiteralOperatorIdentifier(std::string_view &MangledName) { … }
IntrinsicFunctionKind
Demangler::translateIntrinsicFunctionCode(char CH,
FunctionIdentifierCodeGroup Group) { … }
IdentifierNode *
Demangler::demangleFunctionIdentifierCode(std::string_view &MangledName,
FunctionIdentifierCodeGroup Group) { … }
SymbolNode *Demangler::demangleEncodedSymbol(std::string_view &MangledName,
QualifiedNameNode *Name) { … }
SymbolNode *Demangler::demangleDeclarator(std::string_view &MangledName) { … }
SymbolNode *Demangler::demangleMD5Name(std::string_view &MangledName) { … }
SymbolNode *Demangler::demangleTypeinfoName(std::string_view &MangledName) { … }
SymbolNode *Demangler::parse(std::string_view &MangledName) { … }
TagTypeNode *Demangler::parseTagUniqueName(std::string_view &MangledName) { … }
VariableSymbolNode *
Demangler::demangleVariableEncoding(std::string_view &MangledName,
StorageClass SC) { … }
std::pair<uint64_t, bool>
Demangler::demangleNumber(std::string_view &MangledName) { … }
uint64_t Demangler::demangleUnsigned(std::string_view &MangledName) { … }
int64_t Demangler::demangleSigned(std::string_view &MangledName) { … }
void Demangler::memorizeString(std::string_view S) { … }
NamedIdentifierNode *
Demangler::demangleBackRefName(std::string_view &MangledName) { … }
void Demangler::memorizeIdentifier(IdentifierNode *Identifier) { … }
IdentifierNode *
Demangler::demangleTemplateInstantiationName(std::string_view &MangledName,
NameBackrefBehavior NBB) { … }
NamedIdentifierNode *
Demangler::demangleSimpleName(std::string_view &MangledName, bool Memorize) { … }
static bool isRebasedHexDigit(char C) { … }
static uint8_t rebasedHexDigitToNumber(char C) { … }
uint8_t Demangler::demangleCharLiteral(std::string_view &MangledName) { … }
wchar_t Demangler::demangleWcharLiteral(std::string_view &MangledName) { … }
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) { … }
FunctionSymbolNode *
Demangler::demangleVcallThunkNode(std::string_view &MangledName) { … }
EncodedStringLiteralNode *
Demangler::demangleStringLiteral(std::string_view &MangledName) { … }
std::string_view Demangler::demangleSimpleString(std::string_view &MangledName,
bool Memorize) { … }
NamedIdentifierNode *
Demangler::demangleAnonymousNamespaceName(std::string_view &MangledName) { … }
NamedIdentifierNode *
Demangler::demangleLocallyScopedNamePiece(std::string_view &MangledName) { … }
QualifiedNameNode *
Demangler::demangleFullyQualifiedTypeName(std::string_view &MangledName) { … }
QualifiedNameNode *
Demangler::demangleFullyQualifiedSymbolName(std::string_view &MangledName) { … }
IdentifierNode *
Demangler::demangleUnqualifiedTypeName(std::string_view &MangledName,
bool Memorize) { … }
IdentifierNode *
Demangler::demangleUnqualifiedSymbolName(std::string_view &MangledName,
NameBackrefBehavior NBB) { … }
IdentifierNode *
Demangler::demangleNameScopePiece(std::string_view &MangledName) { … }
static NodeArrayNode *nodeListToNodeArray(ArenaAllocator &Arena, NodeList *Head,
size_t Count) { … }
QualifiedNameNode *
Demangler::demangleNameScopeChain(std::string_view &MangledName,
IdentifierNode *UnqualifiedName) { … }
FuncClass Demangler::demangleFunctionClass(std::string_view &MangledName) { … }
CallingConv
Demangler::demangleCallingConvention(std::string_view &MangledName) { … }
StorageClass
Demangler::demangleVariableStorageClass(std::string_view &MangledName) { … }
std::pair<Qualifiers, bool>
Demangler::demangleQualifiers(std::string_view &MangledName) { … }
TypeNode *Demangler::demangleType(std::string_view &MangledName,
QualifierMangleMode QMM) { … }
bool Demangler::demangleThrowSpecification(std::string_view &MangledName) { … }
FunctionSignatureNode *
Demangler::demangleFunctionType(std::string_view &MangledName,
bool HasThisQuals) { … }
FunctionSymbolNode *
Demangler::demangleFunctionEncoding(std::string_view &MangledName) { … }
CustomTypeNode *Demangler::demangleCustomType(std::string_view &MangledName) { … }
PrimitiveTypeNode *
Demangler::demanglePrimitiveType(std::string_view &MangledName) { … }
TagTypeNode *Demangler::demangleClassType(std::string_view &MangledName) { … }
PointerTypeNode *Demangler::demanglePointerType(std::string_view &MangledName) { … }
PointerTypeNode *
Demangler::demangleMemberPointerType(std::string_view &MangledName) { … }
Qualifiers
Demangler::demanglePointerExtQualifiers(std::string_view &MangledName) { … }
ArrayTypeNode *Demangler::demangleArrayType(std::string_view &MangledName) { … }
NodeArrayNode *
Demangler::demangleFunctionParameterList(std::string_view &MangledName,
bool &IsVariadic) { … }
NodeArrayNode *
Demangler::demangleTemplateParameterList(std::string_view &MangledName) { … }
void Demangler::dumpBackReferences() { … }
char *llvm::microsoftDemangle(std::string_view MangledName, size_t *NMangled,
int *Status, MSDemangleFlags Flags) { … }