10 #ifndef LLVM_DEMANGLE_MICROSOFT_DEMANGLE_H 11 #define LLVM_DEMANGLE_MICROSOFT_DEMANGLE_H 21 namespace ms_demangle {
30 struct AllocatorNode {
31 uint8_t *Buf =
nullptr;
34 AllocatorNode *Next =
nullptr;
37 void addNode(
size_t Capacity) {
38 AllocatorNode *NewHead =
new AllocatorNode;
39 NewHead->Buf =
new uint8_t[Capacity];
41 NewHead->Capacity = Capacity;
53 AllocatorNode *Next = Head->Next;
60 uint8_t *Buf = Head->Buf + Head->Used;
63 if (Head->Used > Head->Capacity) {
67 addNode(
std::max(AllocUnit, Length));
72 return reinterpret_cast<char *
>(Buf);
77 size_t Size = Count *
sizeof(
T);
80 size_t P = (
size_t)Head->Buf + Head->Used;
82 (((
size_t)P +
alignof(
T) - 1) & ~(
size_t)(
alignof(
T) - 1));
83 uint8_t *PP = (uint8_t *)AlignedP;
84 size_t Adjustment = AlignedP -
P;
86 Head->Used += Size + Adjustment;
87 if (Head->Used < Head->Capacity)
88 return new (PP)
T[Count]();
92 return new (Head->Buf)
T[Count]();
97 size_t Size =
sizeof(
T);
100 size_t P = (
size_t)Head->Buf + Head->Used;
102 (((
size_t)P +
alignof(
T) - 1) & ~(
size_t)(
alignof(
T) - 1));
103 uint8_t *PP = (uint8_t *)AlignedP;
104 size_t Adjustment = AlignedP -
P;
106 Head->Used += Size + Adjustment;
107 if (Head->Used < Head->Capacity)
108 return new (PP)
T(std::forward<Args>(ConstructorArgs)...);
112 return new (Head->Buf)
T(std::forward<Args>(ConstructorArgs)...);
116 AllocatorNode *Head =
nullptr;
120 static constexpr
size_t Max = 10;
123 size_t FunctionParamCount = 0;
128 size_t NamesCount = 0;
158 void dumpBackReferences();
185 std::pair<uint64_t, bool> demangleNumber(
StringView &MangledName);
186 uint64_t demangleUnsigned(
StringView &MangledName);
187 int64_t demangleSigned(
StringView &MangledName);
212 demangleFunctionIdentifierCode(
StringView &MangledName,
217 demangleConversionOperatorIdentifier(
StringView &MangledName);
219 demangleLiteralOperatorIdentifier(
StringView &MangledName);
223 demangleSpecialTableSymbolNode(
StringView &MangledName,
226 demangleLocalStaticGuard(
StringView &MangledName);
248 bool demangleThrowSpecification(
StringView &MangledName);
249 wchar_t demangleWcharLiteral(
StringView &MangledName);
250 uint8_t demangleCharLiteral(
StringView &MangledName);
252 std::pair<Qualifiers, bool> demangleQualifiers(
StringView &MangledName);
276 #endif // LLVM_DEMANGLE_MICROSOFT_DEMANGLE_H
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents lattice values for constants.
T * allocArray(size_t Count)
constexpr size_t AllocUnit
T * alloc(Args &&... ConstructorArgs)
itanium_demangle::ManglingParser< DefaultAllocator > Demangler
FunctionIdentifierCodeGroup
llvm::Expected< Value > parse(llvm::StringRef JSON)
Parses the provided JSON source, or returns a ParseError.
CHAIN = SC CHAIN, Imm128 - System call.
char * allocUnalignedBuffer(size_t Length)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.