LLVM  16.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 
14 #include "llvm/Demangle/Utility.h"
15 #include <cctype>
16 #include <string>
17 
18 using namespace llvm;
19 using namespace ms_demangle;
20 
21 #define OUTPUT_ENUM_CLASS_VALUE(Enum, Value, Desc) \
22  case Enum::Value: \
23  OB << Desc; \
24  break;
25 
26 // Writes a space if the last token does not end with a punctuation.
27 static void outputSpaceIfNecessary(OutputBuffer &OB) {
28  if (OB.empty())
29  return;
30 
31  char C = OB.back();
32  if (std::isalnum(C) || C == '>')
33  OB << " ";
34 }
35 
36 static void outputSingleQualifier(OutputBuffer &OB, Qualifiers Q) {
37  switch (Q) {
38  case Q_Const:
39  OB << "const";
40  break;
41  case Q_Volatile:
42  OB << "volatile";
43  break;
44  case Q_Restrict:
45  OB << "__restrict";
46  break;
47  default:
48  break;
49  }
50 }
51 
52 static bool outputQualifierIfPresent(OutputBuffer &OB, Qualifiers Q,
53  Qualifiers Mask, bool NeedSpace) {
54  if (!(Q & Mask))
55  return NeedSpace;
56 
57  if (NeedSpace)
58  OB << " ";
59 
61  return true;
62 }
63 
64 static void outputQualifiers(OutputBuffer &OB, Qualifiers Q, bool SpaceBefore,
65  bool SpaceAfter) {
66  if (Q == Q_None)
67  return;
68 
69  size_t Pos1 = OB.getCurrentPosition();
70  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Const, SpaceBefore);
71  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Volatile, SpaceBefore);
72  SpaceBefore = outputQualifierIfPresent(OB, Q, Q_Restrict, SpaceBefore);
73  size_t Pos2 = OB.getCurrentPosition();
74  if (SpaceAfter && Pos2 > Pos1)
75  OB << " ";
76 }
77 
78 static void outputCallingConvention(OutputBuffer &OB, CallingConv CC) {
80 
81  switch (CC) {
82  case CallingConv::Cdecl:
83  OB << "__cdecl";
84  break;
86  OB << "__fastcall";
87  break;
89  OB << "__pascal";
90  break;
92  OB << "__regcall";
93  break;
95  OB << "__stdcall";
96  break;
98  OB << "__thiscall";
99  break;
100  case CallingConv::Eabi:
101  OB << "__eabi";
102  break;
104  OB << "__vectorcall";
105  break;
107  OB << "__clrcall";
108  break;
109  case CallingConv::Swift:
110  OB << "__attribute__((__swiftcall__)) ";
111  break;
113  OB << "__attribute__((__swiftasynccall__)) ";
114  break;
115  default:
116  break;
117  }
118 }
119 
120 std::string Node::toString(OutputFlags Flags) const {
121  OutputBuffer OB;
122  initializeOutputBuffer(nullptr, nullptr, OB, 1024);
123  this->output(OB, Flags);
124  StringView SV = OB;
125  std::string Owned(SV.begin(), SV.end());
126  std::free(OB.getBuffer());
127  return Owned;
128 }
129 
130 void PrimitiveTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
131  switch (PrimKind) {
133  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Bool, "bool");
134  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char, "char");
136  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uchar, "unsigned char");
137  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char8, "char8_t");
138  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char16, "char16_t");
139  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Char32, "char32_t");
141  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Ushort, "unsigned short");
143  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uint, "unsigned int");
145  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Ulong, "unsigned long");
146  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Int64, "__int64");
147  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Uint64, "unsigned __int64");
149  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Float, "float");
150  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Double, "double");
152  OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind, Nullptr, "std::nullptr_t");
153  }
154  outputQualifiers(OB, Quals, true, false);
155 }
156 
157 void NodeArrayNode::output(OutputBuffer &OB, OutputFlags Flags) const {
158  output(OB, Flags, ", ");
159 }
160 
161 void NodeArrayNode::output(OutputBuffer &OB, OutputFlags Flags,
162  StringView Separator) const {
163  if (Count == 0)
164  return;
165  if (Nodes[0])
166  Nodes[0]->output(OB, Flags);
167  for (size_t I = 1; I < Count; ++I) {
168  OB << Separator;
169  Nodes[I]->output(OB, Flags);
170  }
171 }
172 
174  OutputFlags Flags) const {
175  switch (Char) {
176  case CharKind::Wchar:
177  OB << "L\"";
178  break;
179  case CharKind::Char:
180  OB << "\"";
181  break;
182  case CharKind::Char16:
183  OB << "u\"";
184  break;
185  case CharKind::Char32:
186  OB << "U\"";
187  break;
188  }
189  OB << DecodedString << "\"";
190  if (IsTruncated)
191  OB << "...";
192 }
193 
194 void IntegerLiteralNode::output(OutputBuffer &OB, OutputFlags Flags) const {
195  if (IsNegative)
196  OB << '-';
197  OB << Value;
198 }
199 
201  OutputFlags Flags) const {
202  if (ThunkOffsetCount > 0)
203  OB << "{";
205  OB << "&";
206 
207  if (Symbol) {
208  Symbol->output(OB, Flags);
209  if (ThunkOffsetCount > 0)
210  OB << ", ";
211  }
212 
213  if (ThunkOffsetCount > 0)
214  OB << ThunkOffsets[0];
215  for (int I = 1; I < ThunkOffsetCount; ++I) {
216  OB << ", " << ThunkOffsets[I];
217  }
218  if (ThunkOffsetCount > 0)
219  OB << "}";
220 }
221 
223  OutputFlags Flags) const {
224  if (!TemplateParams)
225  return;
226  OB << "<";
227  TemplateParams->output(OB, Flags);
228  OB << ">";
229 }
230 
232  OutputFlags Flags) const {
233  if (IsDestructor)
234  OB << "`dynamic atexit destructor for ";
235  else
236  OB << "`dynamic initializer for ";
237 
238  if (Variable) {
239  OB << "`";
240  Variable->output(OB, Flags);
241  OB << "''";
242  } else {
243  OB << "'";
244  Name->output(OB, Flags);
245  OB << "''";
246  }
247 }
248 
249 void NamedIdentifierNode::output(OutputBuffer &OB, OutputFlags Flags) const {
250  OB << Name;
252 }
253 
255  OutputFlags Flags) const {
256  switch (Operator) {
266  "operator[]");
267  OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind, Pointer, "operator->");
275  "operator->*");
282  "operator>=");
283  OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind, Comma, "operator,");
298  "operator&=");
300  "operator|=");
302  "operator^=");
305  "`vector deleting dtor'");
307  "`default ctor closure'");
309  "`scalar deleting dtor'");
311  "`vector ctor iterator'");
313  "`vector dtor iterator'");
315  "`vector vbase ctor iterator'");
317  "`virtual displacement map'");
319  "`eh vector ctor iterator'");
321  "`eh vector dtor iterator'");
323  "`eh vector vbase ctor iterator'");
325  "`copy ctor closure'");
327  "`local vftable ctor closure'");
330  "operator delete[]");
332  "`managed vector ctor iterator'");
334  "`managed vector dtor iterator'");
336  "`EH vector copy ctor iterator'");
338  "`EH vector vbase copy ctor iterator'");
340  "`vector copy ctor iterator'");
342  "`vector vbase copy constructor iterator'");
344  "`managed vector vbase copy constructor iterator'");
346  "operator co_await");
350  break;
351  }
353 }
354 
356  OutputFlags Flags) const {
357  if (IsThread)
358  OB << "`local static thread guard'";
359  else
360  OB << "`local static guard'";
361  if (ScopeIndex > 0)
362  OB << "{" << ScopeIndex << "}";
363 }
364 
366  OutputFlags Flags) const {
367  OB << "operator";
369  OB << " ";
370  TargetType->output(OB, Flags);
371 }
372 
373 void StructorIdentifierNode::output(OutputBuffer &OB, OutputFlags Flags) const {
374  if (IsDestructor)
375  OB << "~";
376  Class->output(OB, Flags);
378 }
379 
381  OutputFlags Flags) const {
382  OB << "operator \"\"" << Name;
384 }
385 
387  OutputFlags Flags) const {
388  if (!(Flags & OF_NoAccessSpecifier)) {
389  if (FunctionClass & FC_Public)
390  OB << "public: ";
392  OB << "protected: ";
394  OB << "private: ";
395  }
396 
397  if (!(Flags & OF_NoMemberType)) {
398  if (!(FunctionClass & FC_Global)) {
399  if (FunctionClass & FC_Static)
400  OB << "static ";
401  }
403  OB << "virtual ";
404 
406  OB << "extern \"C\" ";
407  }
408 
409  if (!(Flags & OF_NoReturnType) && ReturnType) {
410  ReturnType->outputPre(OB, Flags);
411  OB << " ";
412  }
413 
414  if (!(Flags & OF_NoCallingConvention))
416 }
417 
419  OutputFlags Flags) const {
421  OB << "(";
422  if (Params)
423  Params->output(OB, Flags);
424  else
425  OB << "void";
426 
427  if (IsVariadic) {
428  if (OB.back() != '(')
429  OB << ", ";
430  OB << "...";
431  }
432  OB << ")";
433  }
434 
435  if (Quals & Q_Const)
436  OB << " const";
437  if (Quals & Q_Volatile)
438  OB << " volatile";
439  if (Quals & Q_Restrict)
440  OB << " __restrict";
441  if (Quals & Q_Unaligned)
442  OB << " __unaligned";
443 
444  if (IsNoexcept)
445  OB << " noexcept";
446 
448  OB << " &";
450  OB << " &&";
451 
452  if (!(Flags & OF_NoReturnType) && ReturnType)
453  ReturnType->outputPost(OB, Flags);
454 }
455 
456 void ThunkSignatureNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
457  OB << "[thunk]: ";
458 
460 }
461 
462 void ThunkSignatureNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
464  OB << "`adjustor{" << ThisAdjust.StaticOffset << "}'";
465  } else if (FunctionClass & FC_VirtualThisAdjust) {
467  OB << "`vtordispex{" << ThisAdjust.VBPtrOffset << ", "
469  << ", " << ThisAdjust.StaticOffset << "}'";
470  } else {
471  OB << "`vtordisp{" << ThisAdjust.VtordispOffset << ", "
472  << ThisAdjust.StaticOffset << "}'";
473  }
474  }
475 
477 }
478 
479 void PointerTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
481  // If this is a pointer to a function, don't output the calling convention.
482  // It needs to go inside the parentheses.
483  const FunctionSignatureNode *Sig =
484  static_cast<const FunctionSignatureNode *>(Pointee);
486  } else
487  Pointee->outputPre(OB, Flags);
488 
490 
491  if (Quals & Q_Unaligned)
492  OB << "__unaligned ";
493 
494  if (Pointee->kind() == NodeKind::ArrayType) {
495  OB << "(";
496  } else if (Pointee->kind() == NodeKind::FunctionSignature) {
497  OB << "(";
498  const FunctionSignatureNode *Sig =
499  static_cast<const FunctionSignatureNode *>(Pointee);
501  OB << " ";
502  }
503 
504  if (ClassParent) {
505  ClassParent->output(OB, Flags);
506  OB << "::";
507  }
508 
509  switch (Affinity) {
511  OB << "*";
512  break;
514  OB << "&";
515  break;
517  OB << "&&";
518  break;
519  default:
520  assert(false);
521  }
522  outputQualifiers(OB, Quals, false, false);
523 }
524 
525 void PointerTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
526  if (Pointee->kind() == NodeKind::ArrayType ||
528  OB << ")";
529 
530  Pointee->outputPost(OB, Flags);
531 }
532 
533 void TagTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
534  if (!(Flags & OF_NoTagSpecifier)) {
535  switch (Tag) {
536  OUTPUT_ENUM_CLASS_VALUE(TagKind, Class, "class");
538  OUTPUT_ENUM_CLASS_VALUE(TagKind, Union, "union");
539  OUTPUT_ENUM_CLASS_VALUE(TagKind, Enum, "enum");
540  }
541  OB << " ";
542  }
543  QualifiedName->output(OB, Flags);
544  outputQualifiers(OB, Quals, true, false);
545 }
546 
547 void TagTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {}
548 
549 void ArrayTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
550  ElementType->outputPre(OB, Flags);
551  outputQualifiers(OB, Quals, true, false);
552 }
553 
555  Node *N) const {
556  assert(N->kind() == NodeKind::IntegerLiteral);
557  IntegerLiteralNode *ILN = static_cast<IntegerLiteralNode *>(N);
558  if (ILN->Value != 0)
559  ILN->output(OB, Flags);
560 }
561 
563  OutputFlags Flags) const {
564  if (Dimensions->Count == 0)
565  return;
566 
567  outputOneDimension(OB, Flags, Dimensions->Nodes[0]);
568  for (size_t I = 1; I < Dimensions->Count; ++I) {
569  OB << "][";
571  }
572 }
573 
574 void ArrayTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {
575  OB << "[";
576  outputDimensionsImpl(OB, Flags);
577  OB << "]";
578 
579  ElementType->outputPost(OB, Flags);
580 }
581 
582 void SymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
583  Name->output(OB, Flags);
584 }
585 
586 void FunctionSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
587  Signature->outputPre(OB, Flags);
589  Name->output(OB, Flags);
590  Signature->outputPost(OB, Flags);
591 }
592 
593 void VariableSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
594  const char *AccessSpec = nullptr;
595  bool IsStatic = true;
596  switch (SC) {
598  AccessSpec = "private";
599  break;
601  AccessSpec = "public";
602  break;
604  AccessSpec = "protected";
605  break;
606  default:
607  IsStatic = false;
608  break;
609  }
610  if (!(Flags & OF_NoAccessSpecifier) && AccessSpec)
611  OB << AccessSpec << ": ";
612  if (!(Flags & OF_NoMemberType) && IsStatic)
613  OB << "static ";
614 
615  if (!(Flags & OF_NoVariableType) && Type) {
616  Type->outputPre(OB, Flags);
618  }
619  Name->output(OB, Flags);
620  if (!(Flags & OF_NoVariableType) && Type)
621  Type->outputPost(OB, Flags);
622 }
623 
624 void CustomTypeNode::outputPre(OutputBuffer &OB, OutputFlags Flags) const {
625  Identifier->output(OB, Flags);
626 }
627 void CustomTypeNode::outputPost(OutputBuffer &OB, OutputFlags Flags) const {}
628 
629 void QualifiedNameNode::output(OutputBuffer &OB, OutputFlags Flags) const {
630  Components->output(OB, Flags, "::");
631 }
632 
634  OutputFlags Flags) const {
635  OB << "`RTTI Base Class Descriptor at (";
636  OB << NVOffset << ", " << VBPtrOffset << ", " << VBTableOffset << ", "
637  << this->Flags;
638  OB << ")'";
639 }
640 
642  OutputFlags Flags) const {
643  Name->output(OB, Flags);
644 }
645 
647  OutputFlags Flags) const {
648  OB << "`vcall'{" << OffsetInVTable << ", {flat}}";
649 }
650 
651 void SpecialTableSymbolNode::output(OutputBuffer &OB, OutputFlags Flags) const {
652  outputQualifiers(OB, Quals, false, true);
653  Name->output(OB, Flags);
654  if (TargetName) {
655  OB << "{for `";
656  TargetName->output(OB, Flags);
657  OB << "'}";
658  }
659 }
llvm::ms_demangle::FunctionSignatureNode::FunctionClass
FuncClass FunctionClass
Definition: MicrosoftDemangleNodes.h:337
llvm::ms_demangle::PointerTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:479
llvm::ms_demangle::DynamicStructorIdentifierNode::Name
QualifiedNameNode * Name
Definition: MicrosoftDemangleNodes.h:378
llvm::ms_demangle::FunctionRefQualifier::Reference
@ Reference
llvm::ms_demangle::IntegerLiteralNode::IsNegative
bool IsNegative
Definition: MicrosoftDemangleNodes.h:560
llvm::ms_demangle::LocalStaticGuardVariableNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:641
llvm::ms_demangle::ArrayTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:574
llvm::ms_demangle::VcallThunkIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:646
llvm::ms_demangle::NodeArrayNode::Nodes
Node ** Nodes
Definition: MicrosoftDemangleNodes.h:521
llvm::ms_demangle::FC_Private
@ FC_Private
Definition: MicrosoftDemangleNodes.h:212
llvm::ms_demangle::Node
Definition: MicrosoftDemangleNodes.h:258
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:32
llvm::ms_demangle::TemplateParameterReferenceNode::Symbol
SymbolNode * Symbol
Definition: MicrosoftDemangleNodes.h:544
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseXor
@ BitwiseXor
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseAnd
@ BitwiseAnd
llvm::ms_demangle::IntegerLiteralNode
Definition: MicrosoftDemangleNodes.h:552
llvm::ms_demangle::TemplateParameterReferenceNode::Affinity
PointerAffinity Affinity
Definition: MicrosoftDemangleNodes.h:548
llvm::ms_demangle::NodeKind::FunctionSignature
@ FunctionSignature
llvm::ms_demangle::IntrinsicFunctionKind::DefaultCtorClosure
@ DefaultCtorClosure
llvm::ms_demangle::QualifiedNameNode::Components
NodeArrayNode * Components
Definition: MicrosoftDemangleNodes.h:530
llvm::ms_demangle::OF_NoTagSpecifier
@ OF_NoTagSpecifier
Definition: MicrosoftDemangleNodes.h:78
llvm::ms_demangle::SpecialTableSymbolNode::TargetName
QualifiedNameNode * TargetName
Definition: MicrosoftDemangleNodes.h:586
llvm::ms_demangle::ThunkSignatureNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:462
llvm::ms_demangle::IntrinsicFunctionKind::Equals
@ Equals
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VBPtrOffset
int32_t VBPtrOffset
Definition: MicrosoftDemangleNodes.h:450
llvm::ms_demangle::CallingConv::Pascal
@ Pascal
llvm::ms_demangle::StructorIdentifierNode::IsDestructor
bool IsDestructor
Definition: MicrosoftDemangleNodes.h:439
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:627
llvm::ms_demangle::CallingConv::Cdecl
@ Cdecl
llvm::ms_demangle::Q_Restrict
@ Q_Restrict
Definition: MicrosoftDemangleNodes.h:41
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseAndEqual
@ BitwiseAndEqual
llvm::ms_demangle::FunctionSignatureNode
Definition: MicrosoftDemangleNodes.h:322
llvm::ms_demangle::FunctionSymbolNode::Signature
FunctionSignatureNode * Signature
Definition: MicrosoftDemangleNodes.h:623
llvm::ms_demangle::LiteralOperatorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:380
llvm::ms_demangle::SpecialTableSymbolNode::Quals
Qualifiers Quals
Definition: MicrosoftDemangleNodes.h:587
llvm::ms_demangle::IntrinsicFunctionKind::RshEqual
@ RshEqual
llvm::ms_demangle::TagTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:547
llvm::ms_demangle::Q_Unaligned
@ Q_Unaligned
Definition: MicrosoftDemangleNodes.h:40
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:377
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:222
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:36
llvm::ms_demangle::ArrayTypeNode::Dimensions
NodeArrayNode * Dimensions
Definition: MicrosoftDemangleNodes.h:494
llvm::ms_demangle::IntrinsicFunctionKind::ManVectorVbaseCopyCtorIter
@ ManVectorVbaseCopyCtorIter
llvm::ms_demangle::Node::output
virtual void output(OutputBuffer &OB, OutputFlags Flags) const =0
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:105
llvm::ms_demangle::IntrinsicFunctionKind::TimesEqual
@ TimesEqual
llvm::ms_demangle::IntrinsicFunctionKind::LshEqual
@ LshEqual
llvm::ms_demangle::IntrinsicFunctionKind::EHVectorCopyCtorIter
@ EHVectorCopyCtorIter
llvm::ms_demangle::PrimitiveTypeNode::PrimKind
PrimitiveKind PrimKind
Definition: MicrosoftDemangleNodes.h:319
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
llvm::ms_demangle::ConversionOperatorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:365
llvm::ms_demangle::VariableSymbolNode::SC
StorageClass SC
Definition: MicrosoftDemangleNodes.h:614
llvm::ms_demangle::FC_Global
@ FC_Global
Definition: MicrosoftDemangleNodes.h:213
llvm::BitmaskEnumDetail::Mask
constexpr 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::LeftShift
@ LeftShift
llvm::ms_demangle::IntrinsicFunctionKind::LogicalNot
@ LogicalNot
outputQualifiers
static void outputQualifiers(OutputBuffer &OB, Qualifiers Q, bool SpaceBefore, bool SpaceAfter)
Definition: MicrosoftDemangleNodes.cpp:64
llvm::ms_demangle::FC_Static
@ FC_Static
Definition: MicrosoftDemangleNodes.h:214
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:582
llvm::ms_demangle::OF_NoVariableType
@ OF_NoVariableType
Definition: MicrosoftDemangleNodes.h:82
llvm::ms_demangle::CallingConv
CallingConv
Definition: MicrosoftDemangleNodes.h:58
llvm::ms_demangle::OF_NoCallingConvention
@ OF_NoCallingConvention
Definition: MicrosoftDemangleNodes.h:77
llvm::ms_demangle::FC_NoParameterList
@ FC_NoParameterList
Definition: MicrosoftDemangleNodes.h:218
llvm::ms_demangle::IntrinsicFunctionKind::ArrayDelete
@ ArrayDelete
llvm::ms_demangle::CharKind::Wchar
@ Wchar
llvm::ms_demangle::IntrinsicFunctionKind
IntrinsicFunctionKind
Definition: MicrosoftDemangleNodes.h:117
llvm::ms_demangle::FunctionSignatureNode::CallConvention
CallingConv CallConvention
Definition: MicrosoftDemangleNodes.h:334
llvm::ms_demangle::FunctionSignatureNode::ReturnType
TypeNode * ReturnType
Definition: MicrosoftDemangleNodes.h:342
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:373
outputCallingConvention
static void outputCallingConvention(OutputBuffer &OB, CallingConv CC)
Definition: MicrosoftDemangleNodes.cpp:78
llvm::ms_demangle::CallingConv::Vectorcall
@ Vectorcall
llvm::ms_demangle::PointerTypeNode::Pointee
TypeNode * Pointee
Definition: MicrosoftDemangleNodes.h:471
llvm::ms_demangle::FC_StaticThisAdjust
@ FC_StaticThisAdjust
Definition: MicrosoftDemangleNodes.h:221
llvm::ms_demangle::RttiBaseClassDescriptorNode::VBPtrOffset
int32_t VBPtrOffset
Definition: MicrosoftDemangleNodes.h:570
llvm::ms_demangle::OF_NoReturnType
@ OF_NoReturnType
Definition: MicrosoftDemangleNodes.h:81
llvm::ms_demangle::IntrinsicFunctionKind::NotEquals
@ NotEquals
llvm::ms_demangle::CharKind::Char16
@ Char16
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::StaticOffset
uint32_t StaticOffset
Definition: MicrosoftDemangleNodes.h:449
Long
@ Long
Definition: TargetLibraryInfo.cpp:50
llvm::ms_demangle::ArrayTypeNode::outputDimensionsImpl
void outputDimensionsImpl(OutputBuffer &OB, OutputFlags Flags) const
Definition: MicrosoftDemangleNodes.cpp:562
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:569
llvm::ms_demangle::IntrinsicFunctionKind::CoAwait
@ CoAwait
llvm::ms_demangle::CustomTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:624
llvm::ms_demangle::CallingConv::Eabi
@ Eabi
llvm::ms_demangle::IntrinsicFunctionKind::VbaseDtor
@ VbaseDtor
Int
@ Int
Definition: TargetLibraryInfo.cpp:48
llvm::ms_demangle::LocalStaticGuardIdentifierNode::IsThread
bool IsThread
Definition: MicrosoftDemangleNodes.h:415
llvm::ms_demangle::EncodedStringLiteralNode::IsTruncated
bool IsTruncated
Definition: MicrosoftDemangleNodes.h:605
llvm::ms_demangle::IntrinsicFunctionKind::VecVbaseCtorIter
@ VecVbaseCtorIter
llvm::ms_demangle::OF_NoMemberType
@ OF_NoMemberType
Definition: MicrosoftDemangleNodes.h:80
llvm::ms_demangle::Node::kind
NodeKind kind() const
Definition: MicrosoftDemangleNodes.h:262
llvm::ms_demangle::FunctionSignatureNode::RefQualifier
FunctionRefQualifier RefQualifier
Definition: MicrosoftDemangleNodes.h:339
llvm::ms_demangle::StructorIdentifierNode::Class
IdentifierNode * Class
Definition: MicrosoftDemangleNodes.h:438
llvm::ms_demangle::TagTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:533
llvm::ms_demangle::DynamicStructorIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:231
llvm::ms_demangle::IntrinsicFunctionKind::Increment
@ Increment
llvm::ms_demangle::IntegerLiteralNode::Value
uint64_t Value
Definition: MicrosoftDemangleNodes.h:559
llvm::ms_demangle::NodeArrayNode::Count
size_t Count
Definition: MicrosoftDemangleNodes.h:522
llvm::ms_demangle::StorageClass::PrivateStatic
@ PrivateStatic
llvm::ms_demangle::ArrayTypeNode::outputOneDimension
void outputOneDimension(OutputBuffer &OB, OutputFlags Flags, Node *N) const
Definition: MicrosoftDemangleNodes.cpp:554
llvm::ms_demangle::CallingConv::Thiscall
@ Thiscall
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseOrEqual
@ BitwiseOrEqual
llvm::ms_demangle::FC_Public
@ FC_Public
Definition: MicrosoftDemangleNodes.h:210
llvm::ms_demangle::Q_None
@ Q_None
Definition: MicrosoftDemangleNodes.h:35
outputSpaceIfNecessary
static void outputSpaceIfNecessary(OutputBuffer &OB)
Definition: MicrosoftDemangleNodes.cpp:27
llvm::ms_demangle::FC_VirtualThisAdjustEx
@ FC_VirtualThisAdjustEx
Definition: MicrosoftDemangleNodes.h:220
llvm::ms_demangle::DynamicStructorIdentifierNode::IsDestructor
bool IsDestructor
Definition: MicrosoftDemangleNodes.h:379
llvm::ms_demangle::IntrinsicFunctionKind::LogicalOr
@ LogicalOr
llvm::ms_demangle::CharKind::Char32
@ Char32
QualifiedName
Definition: ItaniumDemangle.h:1054
llvm::ms_demangle::NodeArrayNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:157
llvm::ms_demangle::IntrinsicFunctionKind::Dereference
@ Dereference
Qualifiers
Qualifiers
Definition: ItaniumDemangle.h:393
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:387
llvm::ms_demangle::Q_Volatile
@ Q_Volatile
Definition: MicrosoftDemangleNodes.h:37
llvm::ms_demangle::IntrinsicFunctionKind::VecCtorIter
@ VecCtorIter
llvm::ms_demangle::LiteralOperatorIdentifierNode::Name
StringView Name
Definition: MicrosoftDemangleNodes.h:406
MicrosoftDemangleNodes.h
llvm::ms_demangle::CustomTypeNode::Identifier
IdentifierNode * Identifier
Definition: MicrosoftDemangleNodes.h:511
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:120
llvm::ms_demangle::IntrinsicFunctionKind::RightShift
@ RightShift
llvm::ms_demangle::VcallThunkIdentifierNode::OffsetInVTable
uint64_t OffsetInVTable
Definition: MicrosoftDemangleNodes.h:368
llvm::ms_demangle::IntrinsicFunctionKind::VecDtorIter
@ VecDtorIter
llvm::ms_demangle::ArrayTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:549
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:200
llvm::ms_demangle::IntrinsicFunctionIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:254
llvm::ms_demangle::FunctionSymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:586
llvm::ms_demangle::IdentifierNode::TemplateParams
NodeArrayNode * TemplateParams
Definition: MicrosoftDemangleNodes.h:357
llvm::ms_demangle::TemplateParameterReferenceNode::ThunkOffsets
std::array< int64_t, 3 > ThunkOffsets
Definition: MicrosoftDemangleNodes.h:547
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:426
llvm::ms_demangle::LocalStaticGuardIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:355
llvm::ms_demangle::IntrinsicFunctionKind::VdispMap
@ VdispMap
outputQualifierIfPresent
static bool outputQualifierIfPresent(OutputBuffer &OB, Qualifiers Q, Qualifiers Mask, bool NeedSpace)
Definition: MicrosoftDemangleNodes.cpp:52
llvm::ms_demangle::IntrinsicFunctionKind::DivEqual
@ DivEqual
llvm::ms_demangle::PrimitiveKind::Ushort
@ Ushort
llvm::ms_demangle::FC_VirtualThisAdjust
@ FC_VirtualThisAdjust
Definition: MicrosoftDemangleNodes.h:219
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:386
llvm::ms_demangle::IntrinsicFunctionKind::ManVectorDtorIter
@ ManVectorDtorIter
CC
auto CC
Definition: RISCVRedundantCopyElimination.cpp:79
llvm::ms_demangle::ThunkSignatureNode::ThisAdjust
ThisAdjustor ThisAdjust
Definition: MicrosoftDemangleNodes.h:455
llvm::ms_demangle::SpecialTableSymbolNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:651
llvm::ms_demangle::NamedIdentifierNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:249
llvm::ms_demangle::TypeNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.h:304
llvm::ms_demangle::IntrinsicFunctionKind::BitwiseXorEqual
@ BitwiseXorEqual
llvm::ms_demangle::RttiBaseClassDescriptorNode::VBTableOffset
uint32_t VBTableOffset
Definition: MicrosoftDemangleNodes.h:571
llvm::ms_demangle::PrimitiveKind
PrimitiveKind
Definition: MicrosoftDemangleNodes.h:86
llvm::ms_demangle::PrimitiveTypeNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:130
llvm::ms_demangle::PrimitiveKind::Uint64
@ Uint64
llvm::ms_demangle::EncodedStringLiteralNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:173
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:79
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:201
llvm::ms_demangle::FunctionSignatureNode::Params
NodeArrayNode * Params
Definition: MicrosoftDemangleNodes.h:348
llvm::ms_demangle::TypeNode::Quals
Qualifiers Quals
Definition: MicrosoftDemangleNodes.h:309
llvm::ms_demangle::ArrayTypeNode::ElementType
TypeNode * ElementType
Definition: MicrosoftDemangleNodes.h:497
llvm::ms_demangle::PrimitiveKind::Uchar
@ Uchar
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VBOffsetOffset
int32_t VBOffsetOffset
Definition: MicrosoftDemangleNodes.h:451
llvm::ms_demangle::PrimitiveKind::Short
@ Short
llvm::ms_demangle::ThunkSignatureNode::ThisAdjustor::VtordispOffset
int32_t VtordispOffset
Definition: MicrosoftDemangleNodes.h:452
llvm::ms_demangle::IntrinsicFunctionKind::MinusEqual
@ MinusEqual
llvm::ms_demangle::FunctionSignatureNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:418
llvm::ms_demangle::IntrinsicFunctionKind::Spaceship
@ Spaceship
llvm::ms_demangle::FunctionSignatureNode::IsVariadic
bool IsVariadic
Definition: MicrosoftDemangleNodes.h:345
llvm::ms_demangle::CallingConv::Clrcall
@ Clrcall
llvm::ms_demangle::IntrinsicFunctionKind::EHVecVbaseCtorIter
@ EHVecVbaseCtorIter
llvm::ms_demangle::CallingConv::Stdcall
@ Stdcall
llvm::ms_demangle::PointerTypeNode::ClassParent
QualifiedNameNode * ClassParent
Definition: MicrosoftDemangleNodes.h:467
OUTPUT_ENUM_CLASS_VALUE
#define OUTPUT_ENUM_CLASS_VALUE(Enum, Value, Desc)
Definition: MicrosoftDemangleNodes.cpp:21
llvm::ms_demangle::IntrinsicFunctionKind::Divide
@ Divide
llvm::ms_demangle::PointerTypeNode::outputPost
void outputPost(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:525
llvm::ms_demangle::QualifiedNameNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:629
llvm::ms_demangle::FC_Protected
@ FC_Protected
Definition: MicrosoftDemangleNodes.h:211
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:604
llvm::ms_demangle::RttiBaseClassDescriptorNode::output
void output(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:633
llvm::ms_demangle::FC_Virtual
@ FC_Virtual
Definition: MicrosoftDemangleNodes.h:215
llvm::ms_demangle::TemplateParameterReferenceNode::ThunkOffsetCount
int ThunkOffsetCount
Definition: MicrosoftDemangleNodes.h:546
N
#define N
llvm::ms_demangle::FC_ExternC
@ FC_ExternC
Definition: MicrosoftDemangleNodes.h:217
llvm::ms_demangle::PrimitiveKind::Uint
@ Uint
llvm::ms_demangle::SymbolNode::Name
QualifiedNameNode * Name
Definition: MicrosoftDemangleNodes.h:578
Struct
@ Struct
Definition: TargetLibraryInfo.cpp:61
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:464
llvm::ms_demangle::RttiBaseClassDescriptorNode::Flags
uint32_t Flags
Definition: MicrosoftDemangleNodes.h:572
llvm::ms_demangle::FunctionSignatureNode::IsNoexcept
bool IsNoexcept
Definition: MicrosoftDemangleNodes.h:351
llvm::ms_demangle::OutputFlags
OutputFlags
Definition: MicrosoftDemangleNodes.h:75
llvm::ms_demangle::EncodedStringLiteralNode::Char
CharKind Char
Definition: MicrosoftDemangleNodes.h:606
llvm::ms_demangle::PrimitiveKind::Wchar
@ Wchar
llvm::ms_demangle::StorageClass::PublicStatic
@ PublicStatic
outputSingleQualifier
static void outputSingleQualifier(OutputBuffer &OB, Qualifiers Q)
Definition: MicrosoftDemangleNodes.cpp:36
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:194
llvm::ms_demangle::TagKind
TagKind
Definition: MicrosoftDemangleNodes.h:224
llvm::ms_demangle::PrimitiveKind::Nullptr
@ Nullptr
Void
@ Void
Definition: TargetLibraryInfo.cpp:44
llvm::ms_demangle::LocalStaticGuardIdentifierNode::ScopeIndex
uint32_t ScopeIndex
Definition: MicrosoftDemangleNodes.h:416
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:593
llvm::ms_demangle::IntrinsicFunctionKind::LogicalAnd
@ LogicalAnd
llvm::ms_demangle::ThunkSignatureNode::outputPre
void outputPre(OutputBuffer &OB, OutputFlags Flags) const override
Definition: MicrosoftDemangleNodes.cpp:456