LLVM  14.0.0git
MicrosoftDemangleNodes.cpp
Go to the documentation of this file.
1 //===- MicrosoftDemangle.cpp ----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines a demangler for MSVC-style mangled symbols.
10 //
11 //===----------------------------------------------------------------------===//
12 
15 #include "llvm/Demangle/Utility.h"
16 #include <cctype>
17 #include <string>
18 
19 using namespace llvm;
20 using namespace ms_demangle;
21 
22 #define OUTPUT_ENUM_CLASS_VALUE(Enum, Value, Desc) \
23  case Enum::Value: \
24  OB << Desc; \
25  break;
26 
27 // Writes a space if the last token does not end with a punctuation.
28 static void outputSpaceIfNecessary(OutputBuffer &OB) {
29  if (OB.empty())
30  return;
31 
32  char C = OB.back();
33  if (std::isalnum(C) || C == '>')
34  OB << " ";
35 }
36 
37 static void outputSingleQualifier(OutputBuffer &OB, Qualifiers Q) {
38  switch (Q) {
39  case Q_Const:
40  OB << "const";
41  break;
42  case Q_Volatile:
43  OB << "volatile";
44  break;
45  case Q_Restrict:
46  OB << "__restrict";
47  break;
48  default:
49  break;
50  }
51 }
52 
53 static bool outputQualifierIfPresent(OutputBuffer &OB, Qualifiers Q,
54  Qualifiers Mask, bool NeedSpace) {
55  if (!(Q & Mask))
56  return NeedSpace;
57 
58  if (NeedSpace)
59  OB << " ";
60 
62  return true;
63 }
64 
65 static void outputQualifiers(OutputBuffer &OB, Qualifiers Q, bool SpaceBefore,
66  bool SpaceAfter) {
67  if (Q == Q_None)
68  return;
69 
70  size_t Pos1 = OB.getCurrentPosition();
71  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Const, SpaceBefore);
72  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Volatile, SpaceBefore);
73  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Restrict, SpaceBefore);
74  size_t Pos2 = OB.getCurrentPosition();
75  if (SpaceAfter && Pos2 > Pos1)
76  OB << " ";
77 }
78 
79 static void outputCallingConvention(OutputBuffer &OB, CallingConv CC) {
81 
82  switch (CC) {
83  case CallingConv::Cdecl:
84  OB << "__cdecl";
85  break;
87  OB << "__fastcall";
88  break;
90  OB << "__pascal";
91  break;
93  OB << "__regcall";
94  break;
96  OB << "__stdcall";
97  break;
99  OB << "__thiscall";
100  break;
101  case CallingConv::Eabi:
102  OB << "__eabi";
103  break;
105  OB << "__vectorcall";
106  break;
108  OB << "__clrcall";
109  break;
110  case CallingConv::Swift:
111  OB << "__attribute__((__swiftcall__)) ";
112  break;
114  OB << "__attribute__((__swiftasynccall__)) ";
115  break;
116  default:
117  break;
118  }
119 }
120 
121 std::string Node::toString(OutputFlags Flags) const {
122  OutputBuffer OB;
123  initializeOutputBuffer(nullptr, nullptr, OB, 1024);
124  this->output(OB, Flags);
125  OB << '\0';
126  std::string Owned(OB.getBuffer());
127  std::free(OB.getBuffer());
128  return Owned;
129 }
130 
131 void PrimitiveTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
132  switch (PrimKind) {
133  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Void, "void");
134  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Bool, "bool");
135  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char, "char");
137  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uchar, "unsigned char");
139  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char16, "char16_t");
140  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char32, "char32_t");
142  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Ushort, "unsigned short");
144  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uint, "unsigned int");
145  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Long, "long");
146  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Ulong, "unsigned long");
147  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Int64, "__int64");
148  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uint64, "unsigned __int64");
150  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Float, "float");
151  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Double, "double");
153  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Nullptr, "std::nullptr_t");
154  }
155  outputQualifiers(OB, Quals, true, false);
156 }
157 
158 void NodeArrayNode::output(OutputBuffer &OB, OutputFlags Flags) const {
159  output(OB, Flags, ", ");
160 }
161 
162 void NodeArrayNode::output(OutputBuffer &OB, OutputFlags Flags,
163  StringView Separator) const {
164  if (Count == 0)
165  return;
166  if (Nodes[0])
167  Nodes[0]->output(OB, Flags);
168  for (size_t I = 1; I < Count; ++I) {
169  OB << Separator;
170  Nodes[I]->output(OB, Flags);
171  }
172 }
173 
175  OutputFlags Flags) const {
176  switch (Char) {
177  case CharKind::Wchar:
178  OB << "L\"";
179  break;
180  case CharKind::Char:
181  OB << "\"";
182  break;
183  case CharKind::Char16:
184  OB << "u\"";
185  break;
186  case CharKind::Char32:
187  OB << "U\"";
188  break;
189  }
190  OB << DecodedString << "\"";
191  if (IsTruncated)
192  OB << "...";
193 }
194 
195 void IntegerLiteralNode::output(OutputBuffer &OB, OutputFlags Flags) const {
196  if (IsNegative)
197  OB << '-';
198  OB << Value;
199 }
200 
202  OutputFlags Flags) const {
203  if (ThunkOffsetCount > 0)
204  OB << "{";
206  OB << "&";
207 
208  if (Symbol) {
209  Symbol->output(OB, Flags);
210  if (ThunkOffsetCount > 0)
211  OB << ", ";
212  }
213 
214  if (ThunkOffsetCount > 0)
215  OB << ThunkOffsets[0];
216  for (int I = 1; I < ThunkOffsetCount; ++I) {
217  OB << ", " << ThunkOffsets[I];
218  }
219  if (ThunkOffsetCount > 0)
220  OB << "}";
221 }
222 
224  OutputFlags Flags) const {
225  if (!TemplateParams)
226  return;
227  OB << "<";
228  TemplateParams->output(OB, Flags);
229  OB << ">";
230 }
231 
233  OutputFlags Flags) const {
234  if (IsDestructor)
235  OB << "`dynamic atexit destructor for ";
236  else
237  OB << "`dynamic initializer for ";
238 
239  if (Variable) {
240  OB << "`";
241  Variable->output(OB, Flags);
242  OB << "''";
243  } else {
244  OB << "'";
245  Name->output(OB, Flags);
246  OB << "''";
247  }
248 }
249 
250 void NamedIdentifierNode::output(OutputBuffer &OB, OutputFlags Flags) const {
251  OB << Name;
253 }
254 
256  OutputFlags Flags) const {
257  switch (Operator) {
267  "operator[]");
268  OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind, Pointer, "operator->");
276  "operator->*");
283  "operator>=");
284  OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind, Comma, "operator,");
299  "operator&=");
301  "operator|=");
303  "operator^=");
306  "`vector deleting dtor'");
308  "`default ctor closure'");
310  "`scalar deleting dtor'");
312  "`vector ctor iterator'");
314  "`vector dtor iterator'");
316  "`vector vbase ctor iterator'");
318  "`virtual displacement map'");
320  "`eh vector ctor iterator'");
322  "`eh vector dtor iterator'");
324  "`eh vector vbase ctor iterator'");
326  "`copy ctor closure'");
328  "`local vftable ctor closure'");
331  "operator delete[]");
333  "`managed vector ctor iterator'");
335  "`managed vector dtor iterator'");
337  "`EH vector copy ctor iterator'");
339  "`EH vector vbase copy ctor iterator'");
341  "`vector copy ctor iterator'");
343  "`vector vbase copy constructor iterator'");
345  "`managed vector vbase copy constructor iterator'");
347  "operator co_await");
351  break;
352  }
354 }
355 
357  OutputFlags Flags) const {
358  if (IsThread)
359  OB << "`local static thread guard'";
360  else
361  OB << "`local static guard'";
362  if (ScopeIndex > 0)
363  OB << "{" << ScopeIndex << "}";
364 }
365 
367  OutputFlags Flags) const {
368  OB << "operator";
370  OB << " ";
371  TargetType->output(OB, Flags);
372 }
373 
374 void StructorIdentifierNode::output(OutputBuffer &OB, OutputFlags Flags) const {
375  if (IsDestructor)
376  OB << "~";
377  Class->output(OB, Flags);
379 }
380 
382  OutputFlags Flags) const {
383  OB << "operator \"\"" << Name;
385 }
386 
388  OutputFlags Flags) const {
389  if (!(Flags & OF_NoAccessSpecifier)) {
390  if (FunctionClass & FC_Public)
391  OB << "public: ";
393  OB << "protected: ";
395  OB << "private: ";
396  }
397 
398  if (!(Flags & OF_NoMemberType)) {
399  if (!(FunctionClass & FC_Global)) {
400  if (FunctionClass & FC_Static)
401  OB << "static ";
402  }
404  OB << "virtual ";
405 
407  OB << "extern \"C\" ";
408  }
409 
410  if (!(Flags & OF_NoReturnType) && ReturnType) {
411  ReturnType->outputPre(OB, Flags);
412  OB << " ";
413  }
414 
415  if (!(Flags & OF_NoCallingConvention))
417 }
418 
420  OutputFlags Flags) const {
422  OB << "(";
423  if (Params)
424  Params->output(OB, Flags);
425  else
426  OB << "void";
427 
428  if (IsVariadic) {
429  if (OB.back() != '(')
430  OB << ", ";
431  OB << "...";
432  }
433  OB << ")";
434  }
435 
436  if (Quals & Q_Const)
437  OB << " const";
438  if (Quals & Q_Volatile)
439  OB << " volatile";
440  if (Quals & Q_Restrict)
441  OB << " __restrict";
442  if (Quals & Q_Unaligned)
443  OB << " __unaligned";
444 
445  if (IsNoexcept)
446  OB << " noexcept";
447 
449  OB << " &";
451  OB << " &&";
452 
453  if (!(Flags & OF_NoReturnType) && ReturnType)
454  ReturnType->outputPost(OB, Flags);
455 }
456 
457 void ThunkSignatureNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
458  OB << "[thunk]: ";
459 
461 }
462 
463 void ThunkSignatureNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
465  OB << "`adjustor{" << ThisAdjust.StaticOffset << "}'";
466  } else if (FunctionClass & FC_VirtualThisAdjust) {
468  OB << "`vtordispex{" << ThisAdjust.VBPtrOffset << ", "
470  << ", " << ThisAdjust.StaticOffset << "}'";
471  } else {
472  OB << "`vtordisp{" << ThisAdjust.VtordispOffset << ", "
473  << ThisAdjust.StaticOffset << "}'";
474  }
475  }
476 
478 }
479 
480 void PointerTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
482  // If this is a pointer to a function, don't output the calling convention.
483  // It needs to go inside the parentheses.
484  const FunctionSignatureNode *Sig =
485  static_cast<const FunctionSignatureNode *>(Pointee);
487  } else
488  Pointee->outputPre(OB, Flags);
489 
491 
492  if (Quals & Q_Unaligned)
493  OB << "__unaligned ";
494 
495  if (Pointee->kind() == NodeKind::ArrayType) {
496  OB << "(";
497  } else if (Pointee->kind() == NodeKind::FunctionSignature) {
498  OB << "(";
499  const FunctionSignatureNode *Sig =
500  static_cast<const FunctionSignatureNode *>(Pointee);
502  OB << " ";
503  }
504 
505  if (ClassParent) {
506  ClassParent->output(OB, Flags);
507  OB << "::";
508  }
509 
510  switch (Affinity) {
512  OB << "*";
513  break;
515  OB << "&";
516  break;
518  OB << "&&";
519  break;
520  default:
521  assert(false);
522  }
523  outputQualifiers(OB, Quals, false, false);
524 }
525 
526 void PointerTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
527  if (Pointee->kind() == NodeKind::ArrayType ||
529  OB << ")";
530 
531  Pointee->outputPost(OB, Flags);
532 }
533 
534 void TagTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
535  if (!(Flags & OF_NoTagSpecifier)) {
536  switch (Tag) {
537  OUTPUT_ENUM_CLASS_VALUE(TagKind, Class, "class");
538  OUTPUT_ENUM_CLASS_VALUE(TagKind, Struct, "struct");
539  OUTPUT_ENUM_CLASS_VALUE(TagKind, Union, "union");
540  OUTPUT_ENUM_CLASS_VALUE(TagKind, Enum, "enum");
541  }
542  OB << " ";
543  }
544  QualifiedName->output(OB, Flags);
545  outputQualifiers(OB, Quals, true, false);
546 }
547 
548 void TagTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {}
549 
550 void ArrayTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
551  ElementType->outputPre(OB, Flags);
552  outputQualifiers(OB, Quals, true, false);
553 }
554 
556  Node *N) const {
557  assert(N->kind() == NodeKind::IntegerLiteral);
558  IntegerLiteralNode *ILN = static_cast<IntegerLiteralNode *>(N);
559  if (ILN->Value != 0)
560  ILN->output(OB, Flags);
561 }
562 
564  OutputFlags Flags) const {
565  if (Dimensions->Count == 0)
566  return;
567 
568  outputOneDimension(OB, Flags, Dimensions->Nodes[0]);
569  for (size_t I = 1; I < Dimensions->Count; ++I) {
570  OB << "][";
572  }
573 }
574 
575 void ArrayTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
576  OB << "[";
577  outputDimensionsImpl(OB, Flags);
578  OB << "]";
579 
580  ElementType->outputPost(OB, Flags);
581 }
582 
583 void SymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
584  Name->output(OB, Flags);
585 }
586 
587 void FunctionSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
588  Signature->outputPre(OB, Flags);
590  Name->output(OB, Flags);
591  Signature->outputPost(OB, Flags);
592 }
593 
594 void VariableSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
595  const char *AccessSpec = nullptr;
596  bool IsStatic = true;
597  switch (SC) {
599  AccessSpec = "private";
600  break;
602  AccessSpec = "public";
603  break;
605  AccessSpec = "protected";
606  break;
607  default:
608  IsStatic = false;
609  break;
610  }
611  if (!(Flags & OF_NoAccessSpecifier) && AccessSpec)
612  OB << AccessSpec << ": ";
613  if (!(Flags & OF_NoMemberType) && IsStatic)
614  OB << "static ";
615 
616  if (!(Flags & OF_NoVariableType) && Type) {
617  Type->outputPre(OB, Flags);
619  }
620  Name->output(OB, Flags);
621  if (!(Flags & OF_NoVariableType) && Type)
622  Type->outputPost(OB, Flags);
623 }
624 
625 void CustomTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
626  Identifier->output(OB, Flags);
627 }
628 void CustomTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {}
629 
630 void QualifiedNameNode::output(OutputBuffer &OB, OutputFlags Flags) const {
631  Components->output(OB, Flags, "::");
632 }
633 
635  OutputFlags Flags) const {
636  OB << "`RTTI Base Class Descriptor at (";
637  OB << NVOffset << ", " << VBPtrOffset << ", " << VBTableOffset << ", "
638  << this->Flags;
639  OB << ")'";
640 }
641 
643  OutputFlags Flags) const {
644  Name->output(OB, Flags);
645 }
646 
648  OutputFlags Flags) const {
649  OB << "`vcall'{" << OffsetInVTable << ", {flat}}";
650 }
651 
652 void SpecialTableSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
653  outputQualifiers(OB, Quals, false, true);
654  Name->output(OB, Flags);
655  if (TargetName) {
656  OB << "{for `";
657  TargetName->output(OB, Flags);
658  OB << "'}";
659  }
660 }
llvm::ms_demangle::FunctionSignatureNode::FunctionClass
FuncClass FunctionClass
Definition: MicrosoftDemangleNodes.h:338
llvm::ms_demangle::PointerTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:480
llvm::ms_demangle::DynamicStructorIdentifierNode::Name
QualifiedNameNode * Name
Definition: MicrosoftDemangleNodes.h:379
llvm::ms_demangle::FunctionRefQualifier::Reference
@ Reference
llvm::ms_demangle::IntegerLiteralNode::IsNegative
bool IsNegative
Definition: MicrosoftDemangleNodes.h:561
llvm::ms_demangle::LocalStaticGuardVariableNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:642
llvm::ms_demangle::ArrayTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:575
llvm::ms_demangle::VcallThunkIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:647
llvm::ms_demangle::NodeArrayNode::Nodes
Node ** Nodes
Definition: MicrosoftDemangleNodes.h:522
llvm::ms_demangle::FC_Private
@ FC_Private
Definition: MicrosoftDemangleNodes.h:213
llvm::ms_demangle::Node
Definition: MicrosoftDemangleNodes.h:259
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::ms_demangle::PrimitiveKind::Ldouble
@ Ldouble
llvm::Operator
This is a utility class that provides an abstraction for the common functionality between Instruction...
Definition: Operator.h:31
llvm::ms_demangle::TemplateParameterReferenceNode::Symbol
SymbolNode * Symbol
Definition: MicrosoftDemangleNodes.h:545
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseXor
@ BitwiseXor
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseAnd
@ BitwiseAnd
llvm::ms_demangle::IntegerLiteralNode
Definition: MicrosoftDemangleNodes.h:553
llvm::ms_demangle::TemplateParameterReferenceNode::Affinity
PointerAffinity Affinity
Definition: MicrosoftDemangleNodes.h:549
llvm::ms_demangle::NodeKind::FunctionSignature
@ FunctionSignature
llvm::ms_demangle::IntrinsicFunctionKind::DefaultCtorClosure
@ DefaultCtorClosure
llvm::ms_demangle::QualifiedNameNode::Components
NodeArrayNode * Components
Definition: MicrosoftDemangleNodes.h:531
llvm::ms_demangle::OF_NoTagSpecifier
@ OF_NoTagSpecifier
Definition: MicrosoftDemangleNodes.h:79
llvm::ms_demangle::SpecialTableSymbolNode::TargetName
QualifiedNameNode * TargetName
Definition: MicrosoftDemangleNodes.h:587
llvm::ms_demangle::ThunkSignatureNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:463
llvm::ms_demangle::IntrinsicFunctionKind::Equals
@ Equals
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VBPtrOffset
int32_t VBPtrOffset
Definition: MicrosoftDemangleNodes.h:451
llvm::ms_demangle::CallingConv::Pascal
@ Pascal
llvm::ms_demangle::StructorIdentifierNode::IsDestructor
bool IsDestructor
Definition: MicrosoftDemangleNodes.h:440
llvm::ms_demangle::PointerAffinity::Pointer
@ Pointer
llvm::ms_demangle::IntrinsicFunctionKind::None
@ None
llvm::ms_demangle::IntrinsicFunctionKind::LessThan
@ LessThan
llvm::ms_demangle::IntrinsicFunctionKind::GreaterThanEqual
@ GreaterThanEqual
llvm::ms_demangle::IntrinsicFunctionKind::MemberPointer
@ MemberPointer
llvm::ms_demangle::CustomTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:628
llvm::ms_demangle::CallingConv::Cdecl
@ Cdecl
llvm::ms_demangle::Q_Restrict
@ Q_Restrict
Definition: MicrosoftDemangleNodes.h:42
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseAndEqual
@ BitwiseAndEqual
llvm::ms_demangle::FunctionSignatureNode
Definition: MicrosoftDemangleNodes.h:323
llvm::ms_demangle::FunctionSymbolNode::Signature
FunctionSignatureNode * Signature
Definition: MicrosoftDemangleNodes.h:624
llvm::ms_demangle::LiteralOperatorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:381
llvm::ms_demangle::SpecialTableSymbolNode::Quals
Qualifiers Quals
Definition: MicrosoftDemangleNodes.h:588
llvm::ms_demangle::IntrinsicFunctionKind::RshEqual
@ RshEqual
llvm::ms_demangle::TagTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:548
llvm::ms_demangle::Q_Unaligned
@ Q_Unaligned
Definition: MicrosoftDemangleNodes.h:41
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
Utility.h
llvm::ms_demangle::DynamicStructorIdentifierNode::Variable
VariableSymbolNode * Variable
Definition: MicrosoftDemangleNodes.h:378
llvm::ms_demangle::IntrinsicFunctionKind::ArrayNew
@ ArrayNew
llvm::ms_demangle::IntrinsicFunctionKind::Delete
@ Delete
llvm::ms_demangle::IdentifierNode::outputTemplateParameters
void outputTemplateParameters(OutputBuffer &OB, OutputFlags Flags) const
Definition: MicrosoftDemangleNodes.cpp:223
llvm::ms_demangle::CallingConv::Swift
@ Swift
llvm::ms_demangle::IntrinsicFunctionKind::EHVectorVbaseCopyCtorIter
@ EHVectorVbaseCopyCtorIter
llvm::ms_demangle::IntrinsicFunctionKind::MaxIntrinsic
@ MaxIntrinsic
llvm::ms_demangle::Q_Const
@ Q_Const
Definition: MicrosoftDemangleNodes.h:37
llvm::ms_demangle::ArrayTypeNode::Dimensions
NodeArrayNode * Dimensions
Definition: MicrosoftDemangleNodes.h:495
llvm::ms_demangle::IntrinsicFunctionKind::ManVectorVbaseCopyCtorIter
@ ManVectorVbaseCopyCtorIter
llvm::ms_demangle::Node::output
virtual void output(OutputBuffer &OB, OutputFlags Flags) const =0
llvm::ms_demangle::IntrinsicFunctionKind::TimesEqual
@ TimesEqual
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
llvm::ms_demangle::IntrinsicFunctionKind::LshEqual
@ LshEqual
llvm::ms_demangle::IntrinsicFunctionKind::EHVectorCopyCtorIter
@ EHVectorCopyCtorIter
llvm::ms_demangle::PrimitiveTypeNode::PrimKind
PrimitiveKind PrimKind
Definition: MicrosoftDemangleNodes.h:320
llvm::ms_demangle::ConversionOperatorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:366
llvm::ms_demangle::VariableSymbolNode::SC
StorageClass SC
Definition: MicrosoftDemangleNodes.h:615
llvm::ms_demangle::FC_Global
@ FC_Global
Definition: MicrosoftDemangleNodes.h:214
llvm::ms_demangle::IntrinsicFunctionKind::LeftShift
@ LeftShift
llvm::ms_demangle::IntrinsicFunctionKind::LogicalNot
@ LogicalNot
outputQualifiers
static void outputQualifiers(OutputBuffer &OB, Qualifiers Q, bool SpaceBefore, bool SpaceAfter)
Definition: MicrosoftDemangleNodes.cpp:65
llvm::ms_demangle::FC_Static
@ FC_Static
Definition: MicrosoftDemangleNodes.h:215
llvm::ms_demangle::TypeNode::outputPost
virtual void outputPost(OutputBuffer &OB, OutputFlags Flags) const =0
llvm::ms_demangle::IntrinsicFunctionKind::VectorCopyCtorIter
@ VectorCopyCtorIter
llvm::ms_demangle::IntrinsicFunctionKind::Assign
@ Assign
llvm::ms_demangle::SymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:583
llvm::ms_demangle::OF_NoVariableType
@ OF_NoVariableType
Definition: MicrosoftDemangleNodes.h:83
llvm::ms_demangle::CallingConv
CallingConv
Definition: MicrosoftDemangleNodes.h:59
llvm::ms_demangle::OF_NoCallingConvention
@ OF_NoCallingConvention
Definition: MicrosoftDemangleNodes.h:78
llvm::ms_demangle::FC_NoParameterList
@ FC_NoParameterList
Definition: MicrosoftDemangleNodes.h:219
llvm::ms_demangle::IntrinsicFunctionKind::ArrayDelete
@ ArrayDelete
llvm::ms_demangle::CharKind::Wchar
@ Wchar
llvm::ms_demangle::IntrinsicFunctionKind
IntrinsicFunctionKind
Definition: MicrosoftDemangleNodes.h:118
llvm::ms_demangle::FunctionSignatureNode::CallConvention
CallingConv CallConvention
Definition: MicrosoftDemangleNodes.h:335
llvm::ms_demangle::FunctionSignatureNode::ReturnType
TypeNode * ReturnType
Definition: MicrosoftDemangleNodes.h:343
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseNot
@ BitwiseNot
llvm::ms_demangle::CallingConv::Fastcall
@ Fastcall
llvm::ms_demangle::StructorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:374
outputCallingConvention
static void outputCallingConvention(OutputBuffer &OB, CallingConv CC)
Definition: MicrosoftDemangleNodes.cpp:79
llvm::ms_demangle::CallingConv::Vectorcall
@ Vectorcall
llvm::ms_demangle::PointerTypeNode::Pointee
TypeNode * Pointee
Definition: MicrosoftDemangleNodes.h:472
llvm::ms_demangle::FC_StaticThisAdjust
@ FC_StaticThisAdjust
Definition: MicrosoftDemangleNodes.h:222
llvm::ms_demangle::RttiBaseClassDescriptorNode::VBPtrOffset
int32_t VBPtrOffset
Definition: MicrosoftDemangleNodes.h:571
llvm::ms_demangle::OF_NoReturnType
@ OF_NoReturnType
Definition: MicrosoftDemangleNodes.h:82
llvm::ms_demangle::IntrinsicFunctionKind::NotEquals
@ NotEquals
llvm::ms_demangle::CharKind::Char16
@ Char16
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::StaticOffset
uint32_t StaticOffset
Definition: MicrosoftDemangleNodes.h:450
llvm::ms_demangle::ArrayTypeNode::outputDimensionsImpl
void outputDimensionsImpl(OutputBuffer &OB, OutputFlags Flags) const
Definition: MicrosoftDemangleNodes.cpp:563
llvm::ms_demangle::IntrinsicFunctionKind::LessThanEqual
@ LessThanEqual
llvm::ms_demangle::IntrinsicFunctionKind::Decrement
@ Decrement
llvm::ms_demangle::IntrinsicFunctionKind::PlusEqual
@ PlusEqual
llvm::ms_demangle::IntrinsicFunctionKind::EHVecDtorIter
@ EHVecDtorIter
llvm::ms_demangle::RttiBaseClassDescriptorNode::NVOffset
uint32_t NVOffset
Definition: MicrosoftDemangleNodes.h:570
llvm::ms_demangle::IntrinsicFunctionKind::CoAwait
@ CoAwait
llvm::ms_demangle::CustomTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:625
llvm::ms_demangle::CallingConv::Eabi
@ Eabi
llvm::ms_demangle::IntrinsicFunctionKind::VbaseDtor
@ VbaseDtor
llvm::ms_demangle::LocalStaticGuardIdentifierNode::IsThread
bool IsThread
Definition: MicrosoftDemangleNodes.h:416
llvm::ms_demangle::EncodedStringLiteralNode::IsTruncated
bool IsTruncated
Definition: MicrosoftDemangleNodes.h:606
llvm::ms_demangle::IntrinsicFunctionKind::VecVbaseCtorIter
@ VecVbaseCtorIter
llvm::ms_demangle::OF_NoMemberType
@ OF_NoMemberType
Definition: MicrosoftDemangleNodes.h:81
llvm::ms_demangle::Node::kind
NodeKind kind() const
Definition: MicrosoftDemangleNodes.h:263
llvm::ms_demangle::FunctionSignatureNode::RefQualifier
FunctionRefQualifier RefQualifier
Definition: MicrosoftDemangleNodes.h:340
llvm::ms_demangle::StructorIdentifierNode::Class
IdentifierNode * Class
Definition: MicrosoftDemangleNodes.h:439
llvm::ms_demangle::TagTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:534
llvm::ms_demangle::DynamicStructorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:232
llvm::ms_demangle::IntrinsicFunctionKind::Increment
@ Increment
llvm::ms_demangle::IntegerLiteralNode::Value
uint64_t Value
Definition: MicrosoftDemangleNodes.h:560
llvm::ms_demangle::NodeArrayNode::Count
size_t Count
Definition: MicrosoftDemangleNodes.h:523
llvm::ms_demangle::StorageClass::PrivateStatic
@ PrivateStatic
llvm::ms_demangle::ArrayTypeNode::outputOneDimension
void outputOneDimension(OutputBuffer &OB, OutputFlags Flags, Node *N) const
Definition: MicrosoftDemangleNodes.cpp:555
llvm::ms_demangle::CallingConv::Thiscall
@ Thiscall
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseOrEqual
@ BitwiseOrEqual
llvm::ms_demangle::FC_Public
@ FC_Public
Definition: MicrosoftDemangleNodes.h:211
llvm::ms_demangle::Q_None
@ Q_None
Definition: MicrosoftDemangleNodes.h:36
outputSpaceIfNecessary
static void outputSpaceIfNecessary(OutputBuffer &OB)
Definition: MicrosoftDemangleNodes.cpp:28
llvm::ms_demangle::FC_VirtualThisAdjustEx
@ FC_VirtualThisAdjustEx
Definition: MicrosoftDemangleNodes.h:221
llvm::ms_demangle::DynamicStructorIdentifierNode::IsDestructor
bool IsDestructor
Definition: MicrosoftDemangleNodes.h:380
llvm::ms_demangle::IntrinsicFunctionKind::LogicalOr
@ LogicalOr
llvm::ms_demangle::CharKind::Char32
@ Char32
QualifiedName
Definition: ItaniumDemangle.h:1017
llvm::ms_demangle::NodeArrayNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:158
llvm::ms_demangle::IntrinsicFunctionKind::Dereference
@ Dereference
Qualifiers
Qualifiers
Definition: ItaniumDemangle.h:423
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::ms_demangle::IntrinsicFunctionKind::ModEqual
@ ModEqual
llvm::ms_demangle::NamedIdentifierNode::Name
StringView Name
Definition: MicrosoftDemangleNodes.h:388
llvm::ms_demangle::Q_Volatile
@ Q_Volatile
Definition: MicrosoftDemangleNodes.h:38
llvm::ms_demangle::IntrinsicFunctionKind::VecCtorIter
@ VecCtorIter
llvm::ms_demangle::LiteralOperatorIdentifierNode::Name
StringView Name
Definition: MicrosoftDemangleNodes.h:407
MicrosoftDemangleNodes.h
llvm::ms_demangle::CustomTypeNode::Identifier
IdentifierNode * Identifier
Definition: MicrosoftDemangleNodes.h:512
llvm::ms_demangle::FunctionRefQualifier::RValueReference
@ RValueReference
llvm::ms_demangle::IntrinsicFunctionKind::Parens
@ Parens
llvm::ms_demangle::IntrinsicFunctionKind::GreaterThan
@ GreaterThan
llvm::ms_demangle::Node::toString
std::string toString(OutputFlags Flags=OF_Default) const
Definition: MicrosoftDemangleNodes.cpp:121
llvm::ms_demangle::IntrinsicFunctionKind::RightShift
@ RightShift
llvm::ms_demangle::VcallThunkIdentifierNode::OffsetInVTable
uint64_t OffsetInVTable
Definition: MicrosoftDemangleNodes.h:369
llvm::ms_demangle::IntrinsicFunctionKind::VecDtorIter
@ VecDtorIter
llvm::ms_demangle::ArrayTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:550
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::ms_demangle::IntrinsicFunctionKind::CopyCtorClosure
@ CopyCtorClosure
llvm::ms_demangle::TemplateParameterReferenceNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:201
llvm::ms_demangle::IntrinsicFunctionIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:255
llvm::ms_demangle::FunctionSymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:587
llvm::ms_demangle::IdentifierNode::TemplateParams
NodeArrayNode * TemplateParams
Definition: MicrosoftDemangleNodes.h:358
llvm::ms_demangle::TemplateParameterReferenceNode::ThunkOffsets
std::array< int64_t, 3 > ThunkOffsets
Definition: MicrosoftDemangleNodes.h:548
llvm::ms_demangle::IntrinsicFunctionKind::Minus
@ Minus
llvm::ms_demangle::IntrinsicFunctionKind::VectorVbaseCopyCtorIter
@ VectorVbaseCopyCtorIter
llvm::ms_demangle::IntrinsicFunctionKind::ManVectorCtorIter
@ ManVectorCtorIter
llvm::ms_demangle::PrimitiveKind::Schar
@ Schar
llvm::ms_demangle::CharKind::Char
@ Char
llvm::ms_demangle::ConversionOperatorIdentifierNode::TargetType
TypeNode * TargetType
Definition: MicrosoftDemangleNodes.h:427
llvm::ms_demangle::LocalStaticGuardIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:356
llvm::ms_demangle::IntrinsicFunctionKind::VdispMap
@ VdispMap
outputQualifierIfPresent
static bool outputQualifierIfPresent(OutputBuffer &OB, Qualifiers Q, Qualifiers Mask, bool NeedSpace)
Definition: MicrosoftDemangleNodes.cpp:53
llvm::ms_demangle::IntrinsicFunctionKind::DivEqual
@ DivEqual
llvm::ms_demangle::PrimitiveKind::Ushort
@ Ushort
llvm::ms_demangle::FC_VirtualThisAdjust
@ FC_VirtualThisAdjust
Definition: MicrosoftDemangleNodes.h:220
llvm::ms_demangle::NodeKind::IntegerLiteral
@ IntegerLiteral
llvm::ms_demangle::IntrinsicFunctionKind::New
@ New
llvm::ms_demangle::FunctionSignatureNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:387
llvm::ms_demangle::IntrinsicFunctionKind::ManVectorDtorIter
@ ManVectorDtorIter
llvm::ms_demangle::ThunkSignatureNode::ThisAdjust
ThisAdjustor ThisAdjust
Definition: MicrosoftDemangleNodes.h:456
llvm::ms_demangle::SpecialTableSymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:652
llvm::ms_demangle::TagTypeNode::Tag
TagKind Tag
Definition: MicrosoftDemangleNodes.h:482
llvm::ms_demangle::NamedIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:250
llvm::ms_demangle::TypeNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.h:305
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseXorEqual
@ BitwiseXorEqual
llvm::ms_demangle::RttiBaseClassDescriptorNode::VBTableOffset
uint32_t VBTableOffset
Definition: MicrosoftDemangleNodes.h:572
llvm::ms_demangle::PrimitiveKind
PrimitiveKind
Definition: MicrosoftDemangleNodes.h:87
DemangleConfig.h
llvm::ms_demangle::PrimitiveTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:131
llvm::ms_demangle::PrimitiveKind::Uint64
@ Uint64
llvm::ms_demangle::EncodedStringLiteralNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:174
llvm::ms_demangle::IntrinsicFunctionKind::Plus
@ Plus
llvm::ms_demangle::IntrinsicFunctionKind::LocalVftableCtorClosure
@ LocalVftableCtorClosure
llvm::ms_demangle::IntrinsicFunctionKind::Modulus
@ Modulus
llvm::ms_demangle::OF_NoAccessSpecifier
@ OF_NoAccessSpecifier
Definition: MicrosoftDemangleNodes.h:80
llvm::ms_demangle::IntrinsicFunctionKind::ScalarDelDtor
@ ScalarDelDtor
llvm::ms_demangle::TypeNode::outputPre
virtual void outputPre(OutputBuffer &OB, OutputFlags Flags) const =0
initializeOutputBuffer
bool initializeOutputBuffer(char *Buf, size_t *N, OutputBuffer &OB, size_t InitSize)
Definition: Utility.h:195
llvm::ms_demangle::FunctionSignatureNode::Params
NodeArrayNode * Params
Definition: MicrosoftDemangleNodes.h:349
llvm::ms_demangle::TypeNode::Quals
Qualifiers Quals
Definition: MicrosoftDemangleNodes.h:310
llvm::ms_demangle::ArrayTypeNode::ElementType
TypeNode * ElementType
Definition: MicrosoftDemangleNodes.h:498
llvm::ms_demangle::PrimitiveKind::Uchar
@ Uchar
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VBOffsetOffset
int32_t VBOffsetOffset
Definition: MicrosoftDemangleNodes.h:452
llvm::ms_demangle::PrimitiveKind::Short
@ Short
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VtordispOffset
int32_t VtordispOffset
Definition: MicrosoftDemangleNodes.h:453
llvm::ms_demangle::IntrinsicFunctionKind::MinusEqual
@ MinusEqual
llvm::ms_demangle::FunctionSignatureNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:419
llvm::ms_demangle::IntrinsicFunctionKind::Spaceship
@ Spaceship
llvm::ms_demangle::FunctionSignatureNode::IsVariadic
bool IsVariadic
Definition: MicrosoftDemangleNodes.h:346
llvm::ms_demangle::CallingConv::Clrcall
@ Clrcall
llvm::ms_demangle::IntrinsicFunctionKind::EHVecVbaseCtorIter
@ EHVecVbaseCtorIter
llvm::ms_demangle::PrimitiveKind::Char8
@ Char8
llvm::ms_demangle::CallingConv::Stdcall
@ Stdcall
llvm::ms_demangle::PointerTypeNode::ClassParent
QualifiedNameNode * ClassParent
Definition: MicrosoftDemangleNodes.h:468
OUTPUT_ENUM_CLASS_VALUE
#define OUTPUT_ENUM_CLASS_VALUE(Enum, Value, Desc)
Definition: MicrosoftDemangleNodes.cpp:22
llvm::ms_demangle::IntrinsicFunctionKind::Divide
@ Divide
llvm::ms_demangle::PointerTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:526
llvm::ms_demangle::QualifiedNameNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:630
llvm::ms_demangle::FC_Protected
@ FC_Protected
Definition: MicrosoftDemangleNodes.h:212
llvm::ms_demangle::PointerAffinity::Reference
@ Reference
llvm::ms_demangle::StorageClass::ProtectedStatic
@ ProtectedStatic
llvm::ms_demangle::IntrinsicFunctionKind::VecDelDtor
@ VecDelDtor
llvm::ms_demangle::EncodedStringLiteralNode::DecodedString
StringView DecodedString
Definition: MicrosoftDemangleNodes.h:605
llvm::ms_demangle::RttiBaseClassDescriptorNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:634
llvm::ms_demangle::FC_Virtual
@ FC_Virtual
Definition: MicrosoftDemangleNodes.h:216
llvm::ms_demangle::TemplateParameterReferenceNode::ThunkOffsetCount
int ThunkOffsetCount
Definition: MicrosoftDemangleNodes.h:547
N
#define N
llvm::ms_demangle::FC_ExternC
@ FC_ExternC
Definition: MicrosoftDemangleNodes.h:218
llvm::ms_demangle::PrimitiveKind::Uint
@ Uint
llvm::ms_demangle::SymbolNode::Name
QualifiedNameNode * Name
Definition: MicrosoftDemangleNodes.h:579
llvm::ms_demangle::IntrinsicFunctionKind::ArraySubscript
@ ArraySubscript
llvm::ms_demangle::IntrinsicFunctionKind::EHVecCtorIter
@ EHVecCtorIter
llvm::ms_demangle::CallingConv::Regcall
@ Regcall
llvm::ms_demangle::CallingConv::SwiftAsync
@ SwiftAsync
llvm::ms_demangle::PointerTypeNode::Affinity
PointerAffinity Affinity
Definition: MicrosoftDemangleNodes.h:465
llvm::ms_demangle::RttiBaseClassDescriptorNode::Flags
uint32_t Flags
Definition: MicrosoftDemangleNodes.h:573
llvm::ms_demangle::FunctionSignatureNode::IsNoexcept
bool IsNoexcept
Definition: MicrosoftDemangleNodes.h:352
llvm::ms_demangle::OutputFlags
OutputFlags
Definition: MicrosoftDemangleNodes.h:76
llvm::ms_demangle::EncodedStringLiteralNode::Char
CharKind Char
Definition: MicrosoftDemangleNodes.h:607
llvm::ms_demangle::PrimitiveKind::Wchar
@ Wchar
llvm::ms_demangle::StorageClass::PublicStatic
@ PublicStatic
outputSingleQualifier
static void outputSingleQualifier(OutputBuffer &OB, Qualifiers Q)
Definition: MicrosoftDemangleNodes.cpp:37
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseOr
@ BitwiseOr
llvm::ms_demangle::PrimitiveKind::Ulong
@ Ulong
llvm::ms_demangle::IntegerLiteralNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:195
llvm::ms_demangle::TagKind
TagKind
Definition: MicrosoftDemangleNodes.h:225
llvm::ms_demangle::PrimitiveKind::Nullptr
@ Nullptr
llvm::ms_demangle::LocalStaticGuardIdentifierNode::ScopeIndex
uint32_t ScopeIndex
Definition: MicrosoftDemangleNodes.h:417
llvm::ms_demangle::NodeKind::ArrayType
@ ArrayType
llvm::ms_demangle::PointerAffinity::RValueReference
@ RValueReference
llvm::ms_demangle::VariableSymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:594
llvm::ms_demangle::IntrinsicFunctionKind::LogicalAnd
@ LogicalAnd
llvm::ms_demangle::ThunkSignatureNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:457