1 //===- MicrosoftDemangle.cpp ----------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines a demangler for MSVC-style mangled symbols.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/Demangle/MicrosoftDemangleNodes.h"
14 #include "llvm/Demangle/Utility.h"
19 using namespace ms_demangle
;
21 #define OUTPUT_ENUM_CLASS_VALUE(Enum, Value, Desc) \
26 // Writes a space if the last token does not end with a punctuation.
27 static void outputSpaceIfNecessary(OutputBuffer
&OB
) {
32 if (std::isalnum(C
) || C
== '>')
36 static void outputSingleQualifier(OutputBuffer
&OB
, Qualifiers Q
) {
52 static bool outputQualifierIfPresent(OutputBuffer
&OB
, Qualifiers Q
,
53 Qualifiers Mask
, bool NeedSpace
) {
60 outputSingleQualifier(OB
, Mask
);
64 static void outputQualifiers(OutputBuffer
&OB
, Qualifiers Q
, bool SpaceBefore
,
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
)
78 static void outputCallingConvention(OutputBuffer
&OB
, CallingConv CC
) {
79 outputSpaceIfNecessary(OB
);
82 case CallingConv::Cdecl
:
85 case CallingConv::Fastcall
:
88 case CallingConv::Pascal
:
91 case CallingConv::Regcall
:
94 case CallingConv::Stdcall
:
97 case CallingConv::Thiscall
:
100 case CallingConv::Eabi
:
103 case CallingConv::Vectorcall
:
104 OB
<< "__vectorcall";
106 case CallingConv::Clrcall
:
109 case CallingConv::Swift
:
110 OB
<< "__attribute__((__swiftcall__)) ";
112 case CallingConv::SwiftAsync
:
113 OB
<< "__attribute__((__swiftasynccall__)) ";
120 std::string
Node::toString(OutputFlags Flags
) const {
122 this->output(OB
, Flags
);
123 std::string_view SV
= OB
;
124 std::string
Owned(SV
.begin(), SV
.end());
125 std::free(OB
.getBuffer());
129 void PrimitiveTypeNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
131 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Void
, "void");
132 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Bool
, "bool");
133 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Char
, "char");
134 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Schar
, "signed char");
135 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Uchar
, "unsigned char");
136 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Char8
, "char8_t");
137 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Char16
, "char16_t");
138 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Char32
, "char32_t");
139 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Short
, "short");
140 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Ushort
, "unsigned short");
141 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Int
, "int");
142 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Uint
, "unsigned int");
143 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Long
, "long");
144 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Ulong
, "unsigned long");
145 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Int64
, "__int64");
146 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Uint64
, "unsigned __int64");
147 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Wchar
, "wchar_t");
148 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Float
, "float");
149 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Double
, "double");
150 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Ldouble
, "long double");
151 OUTPUT_ENUM_CLASS_VALUE(PrimitiveKind
, Nullptr
, "std::nullptr_t");
153 outputQualifiers(OB
, Quals
, true, false);
156 void NodeArrayNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
157 output(OB
, Flags
, ", ");
160 void NodeArrayNode::output(OutputBuffer
&OB
, OutputFlags Flags
,
161 std::string_view Separator
) const {
165 Nodes
[0]->output(OB
, Flags
);
166 for (size_t I
= 1; I
< Count
; ++I
) {
168 Nodes
[I
]->output(OB
, Flags
);
172 void EncodedStringLiteralNode::output(OutputBuffer
&OB
,
173 OutputFlags Flags
) const {
175 case CharKind::Wchar
:
181 case CharKind::Char16
:
184 case CharKind::Char32
:
188 OB
<< DecodedString
<< "\"";
193 void IntegerLiteralNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
199 void TemplateParameterReferenceNode::output(OutputBuffer
&OB
,
200 OutputFlags Flags
) const {
201 if (ThunkOffsetCount
> 0)
203 else if (Affinity
== PointerAffinity::Pointer
)
207 Symbol
->output(OB
, Flags
);
208 if (ThunkOffsetCount
> 0)
212 if (ThunkOffsetCount
> 0)
213 OB
<< ThunkOffsets
[0];
214 for (int I
= 1; I
< ThunkOffsetCount
; ++I
) {
215 OB
<< ", " << ThunkOffsets
[I
];
217 if (ThunkOffsetCount
> 0)
221 void IdentifierNode::outputTemplateParameters(OutputBuffer
&OB
,
222 OutputFlags Flags
) const {
226 TemplateParams
->output(OB
, Flags
);
230 void DynamicStructorIdentifierNode::output(OutputBuffer
&OB
,
231 OutputFlags Flags
) const {
233 OB
<< "`dynamic atexit destructor for ";
235 OB
<< "`dynamic initializer for ";
239 Variable
->output(OB
, Flags
);
243 Name
->output(OB
, Flags
);
248 void NamedIdentifierNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
250 outputTemplateParameters(OB
, Flags
);
253 void IntrinsicFunctionIdentifierNode::output(OutputBuffer
&OB
,
254 OutputFlags Flags
) const {
256 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, New
, "operator new");
257 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Delete
, "operator delete");
258 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Assign
, "operator=");
259 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, RightShift
, "operator>>");
260 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LeftShift
, "operator<<");
261 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LogicalNot
, "operator!");
262 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Equals
, "operator==");
263 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, NotEquals
, "operator!=");
264 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ArraySubscript
,
266 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Pointer
, "operator->");
267 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Increment
, "operator++");
268 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Decrement
, "operator--");
269 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Minus
, "operator-");
270 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Plus
, "operator+");
271 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Dereference
, "operator*");
272 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseAnd
, "operator&");
273 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, MemberPointer
,
275 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Divide
, "operator/");
276 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Modulus
, "operator%");
277 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LessThan
, "operator<");
278 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LessThanEqual
, "operator<=");
279 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, GreaterThan
, "operator>");
280 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, GreaterThanEqual
,
282 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Comma
, "operator,");
283 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Parens
, "operator()");
284 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseNot
, "operator~");
285 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseXor
, "operator^");
286 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseOr
, "operator|");
287 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LogicalAnd
, "operator&&");
288 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LogicalOr
, "operator||");
289 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, TimesEqual
, "operator*=");
290 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, PlusEqual
, "operator+=");
291 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, MinusEqual
, "operator-=");
292 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, DivEqual
, "operator/=");
293 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ModEqual
, "operator%=");
294 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, RshEqual
, "operator>>=");
295 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LshEqual
, "operator<<=");
296 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseAndEqual
,
298 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseOrEqual
,
300 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, BitwiseXorEqual
,
302 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VbaseDtor
, "`vbase dtor'");
303 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VecDelDtor
,
304 "`vector deleting dtor'");
305 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, DefaultCtorClosure
,
306 "`default ctor closure'");
307 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ScalarDelDtor
,
308 "`scalar deleting dtor'");
309 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VecCtorIter
,
310 "`vector ctor iterator'");
311 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VecDtorIter
,
312 "`vector dtor iterator'");
313 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VecVbaseCtorIter
,
314 "`vector vbase ctor iterator'");
315 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VdispMap
,
316 "`virtual displacement map'");
317 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, EHVecCtorIter
,
318 "`eh vector ctor iterator'");
319 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, EHVecDtorIter
,
320 "`eh vector dtor iterator'");
321 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, EHVecVbaseCtorIter
,
322 "`eh vector vbase ctor iterator'");
323 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, CopyCtorClosure
,
324 "`copy ctor closure'");
325 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, LocalVftableCtorClosure
,
326 "`local vftable ctor closure'");
327 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ArrayNew
, "operator new[]");
328 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ArrayDelete
,
329 "operator delete[]");
330 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ManVectorCtorIter
,
331 "`managed vector ctor iterator'");
332 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ManVectorDtorIter
,
333 "`managed vector dtor iterator'");
334 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, EHVectorCopyCtorIter
,
335 "`EH vector copy ctor iterator'");
336 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, EHVectorVbaseCopyCtorIter
,
337 "`EH vector vbase copy ctor iterator'");
338 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VectorCopyCtorIter
,
339 "`vector copy ctor iterator'");
340 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, VectorVbaseCopyCtorIter
,
341 "`vector vbase copy constructor iterator'");
342 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, ManVectorVbaseCopyCtorIter
,
343 "`managed vector vbase copy constructor iterator'");
344 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, CoAwait
,
345 "operator co_await");
346 OUTPUT_ENUM_CLASS_VALUE(IntrinsicFunctionKind
, Spaceship
, "operator<=>");
347 case IntrinsicFunctionKind::MaxIntrinsic
:
348 case IntrinsicFunctionKind::None
:
351 outputTemplateParameters(OB
, Flags
);
354 void LocalStaticGuardIdentifierNode::output(OutputBuffer
&OB
,
355 OutputFlags Flags
) const {
357 OB
<< "`local static thread guard'";
359 OB
<< "`local static guard'";
361 OB
<< "{" << ScopeIndex
<< "}";
364 void ConversionOperatorIdentifierNode::output(OutputBuffer
&OB
,
365 OutputFlags Flags
) const {
367 outputTemplateParameters(OB
, Flags
);
369 TargetType
->output(OB
, Flags
);
372 void StructorIdentifierNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
375 Class
->output(OB
, Flags
);
376 outputTemplateParameters(OB
, Flags
);
379 void LiteralOperatorIdentifierNode::output(OutputBuffer
&OB
,
380 OutputFlags Flags
) const {
381 OB
<< "operator \"\"" << Name
;
382 outputTemplateParameters(OB
, Flags
);
385 void FunctionSignatureNode::outputPre(OutputBuffer
&OB
,
386 OutputFlags Flags
) const {
387 if (!(Flags
& OF_NoAccessSpecifier
)) {
388 if (FunctionClass
& FC_Public
)
390 if (FunctionClass
& FC_Protected
)
392 if (FunctionClass
& FC_Private
)
396 if (!(Flags
& OF_NoMemberType
)) {
397 if (!(FunctionClass
& FC_Global
)) {
398 if (FunctionClass
& FC_Static
)
401 if (FunctionClass
& FC_Virtual
)
404 if (FunctionClass
& FC_ExternC
)
405 OB
<< "extern \"C\" ";
408 if (!(Flags
& OF_NoReturnType
) && ReturnType
) {
409 ReturnType
->outputPre(OB
, Flags
);
413 if (!(Flags
& OF_NoCallingConvention
))
414 outputCallingConvention(OB
, CallConvention
);
417 void FunctionSignatureNode::outputPost(OutputBuffer
&OB
,
418 OutputFlags Flags
) const {
419 if (!(FunctionClass
& FC_NoParameterList
)) {
422 Params
->output(OB
, Flags
);
427 if (OB
.back() != '(')
436 if (Quals
& Q_Volatile
)
438 if (Quals
& Q_Restrict
)
440 if (Quals
& Q_Unaligned
)
441 OB
<< " __unaligned";
446 if (RefQualifier
== FunctionRefQualifier::Reference
)
448 else if (RefQualifier
== FunctionRefQualifier::RValueReference
)
451 if (!(Flags
& OF_NoReturnType
) && ReturnType
)
452 ReturnType
->outputPost(OB
, Flags
);
455 void ThunkSignatureNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
458 FunctionSignatureNode::outputPre(OB
, Flags
);
461 void ThunkSignatureNode::outputPost(OutputBuffer
&OB
, OutputFlags Flags
) const {
462 if (FunctionClass
& FC_StaticThisAdjust
) {
463 OB
<< "`adjustor{" << ThisAdjust
.StaticOffset
<< "}'";
464 } else if (FunctionClass
& FC_VirtualThisAdjust
) {
465 if (FunctionClass
& FC_VirtualThisAdjustEx
) {
466 OB
<< "`vtordispex{" << ThisAdjust
.VBPtrOffset
<< ", "
467 << ThisAdjust
.VBOffsetOffset
<< ", " << ThisAdjust
.VtordispOffset
468 << ", " << ThisAdjust
.StaticOffset
<< "}'";
470 OB
<< "`vtordisp{" << ThisAdjust
.VtordispOffset
<< ", "
471 << ThisAdjust
.StaticOffset
<< "}'";
475 FunctionSignatureNode::outputPost(OB
, Flags
);
478 void PointerTypeNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
479 if (Pointee
->kind() == NodeKind::FunctionSignature
) {
480 // If this is a pointer to a function, don't output the calling convention.
481 // It needs to go inside the parentheses.
482 const FunctionSignatureNode
*Sig
=
483 static_cast<const FunctionSignatureNode
*>(Pointee
);
484 Sig
->outputPre(OB
, OF_NoCallingConvention
);
486 Pointee
->outputPre(OB
, Flags
);
488 outputSpaceIfNecessary(OB
);
490 if (Quals
& Q_Unaligned
)
491 OB
<< "__unaligned ";
493 if (Pointee
->kind() == NodeKind::ArrayType
) {
495 } else if (Pointee
->kind() == NodeKind::FunctionSignature
) {
497 const FunctionSignatureNode
*Sig
=
498 static_cast<const FunctionSignatureNode
*>(Pointee
);
499 outputCallingConvention(OB
, Sig
->CallConvention
);
504 ClassParent
->output(OB
, Flags
);
509 case PointerAffinity::Pointer
:
512 case PointerAffinity::Reference
:
515 case PointerAffinity::RValueReference
:
521 outputQualifiers(OB
, Quals
, false, false);
524 void PointerTypeNode::outputPost(OutputBuffer
&OB
, OutputFlags Flags
) const {
525 if (Pointee
->kind() == NodeKind::ArrayType
||
526 Pointee
->kind() == NodeKind::FunctionSignature
)
529 Pointee
->outputPost(OB
, Flags
);
532 void TagTypeNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
533 if (!(Flags
& OF_NoTagSpecifier
)) {
535 OUTPUT_ENUM_CLASS_VALUE(TagKind
, Class
, "class");
536 OUTPUT_ENUM_CLASS_VALUE(TagKind
, Struct
, "struct");
537 OUTPUT_ENUM_CLASS_VALUE(TagKind
, Union
, "union");
538 OUTPUT_ENUM_CLASS_VALUE(TagKind
, Enum
, "enum");
542 QualifiedName
->output(OB
, Flags
);
543 outputQualifiers(OB
, Quals
, true, false);
546 void TagTypeNode::outputPost(OutputBuffer
&OB
, OutputFlags Flags
) const {}
548 void ArrayTypeNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
549 ElementType
->outputPre(OB
, Flags
);
550 outputQualifiers(OB
, Quals
, true, false);
553 void ArrayTypeNode::outputOneDimension(OutputBuffer
&OB
, OutputFlags Flags
,
555 assert(N
->kind() == NodeKind::IntegerLiteral
);
556 IntegerLiteralNode
*ILN
= static_cast<IntegerLiteralNode
*>(N
);
558 ILN
->output(OB
, Flags
);
561 void ArrayTypeNode::outputDimensionsImpl(OutputBuffer
&OB
,
562 OutputFlags Flags
) const {
563 if (Dimensions
->Count
== 0)
566 outputOneDimension(OB
, Flags
, Dimensions
->Nodes
[0]);
567 for (size_t I
= 1; I
< Dimensions
->Count
; ++I
) {
569 outputOneDimension(OB
, Flags
, Dimensions
->Nodes
[I
]);
573 void ArrayTypeNode::outputPost(OutputBuffer
&OB
, OutputFlags Flags
) const {
575 outputDimensionsImpl(OB
, Flags
);
578 ElementType
->outputPost(OB
, Flags
);
581 void SymbolNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
582 Name
->output(OB
, Flags
);
585 void FunctionSymbolNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
586 Signature
->outputPre(OB
, Flags
);
587 outputSpaceIfNecessary(OB
);
588 Name
->output(OB
, Flags
);
589 Signature
->outputPost(OB
, Flags
);
592 void VariableSymbolNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
593 const char *AccessSpec
= nullptr;
594 bool IsStatic
= true;
596 case StorageClass::PrivateStatic
:
597 AccessSpec
= "private";
599 case StorageClass::PublicStatic
:
600 AccessSpec
= "public";
602 case StorageClass::ProtectedStatic
:
603 AccessSpec
= "protected";
609 if (!(Flags
& OF_NoAccessSpecifier
) && AccessSpec
)
610 OB
<< AccessSpec
<< ": ";
611 if (!(Flags
& OF_NoMemberType
) && IsStatic
)
614 if (!(Flags
& OF_NoVariableType
) && Type
) {
615 Type
->outputPre(OB
, Flags
);
616 outputSpaceIfNecessary(OB
);
618 Name
->output(OB
, Flags
);
619 if (!(Flags
& OF_NoVariableType
) && Type
)
620 Type
->outputPost(OB
, Flags
);
623 void CustomTypeNode::outputPre(OutputBuffer
&OB
, OutputFlags Flags
) const {
624 Identifier
->output(OB
, Flags
);
626 void CustomTypeNode::outputPost(OutputBuffer
&OB
, OutputFlags Flags
) const {}
628 void QualifiedNameNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
629 Components
->output(OB
, Flags
, "::");
632 void RttiBaseClassDescriptorNode::output(OutputBuffer
&OB
,
633 OutputFlags Flags
) const {
634 OB
<< "`RTTI Base Class Descriptor at (";
635 OB
<< NVOffset
<< ", " << VBPtrOffset
<< ", " << VBTableOffset
<< ", "
640 void LocalStaticGuardVariableNode::output(OutputBuffer
&OB
,
641 OutputFlags Flags
) const {
642 Name
->output(OB
, Flags
);
645 void VcallThunkIdentifierNode::output(OutputBuffer
&OB
,
646 OutputFlags Flags
) const {
647 OB
<< "`vcall'{" << OffsetInVTable
<< ", {flat}}";
650 void SpecialTableSymbolNode::output(OutputBuffer
&OB
, OutputFlags Flags
) const {
651 outputQualifiers(OB
, Quals
, false, true);
652 Name
->output(OB
, Flags
);
655 TargetName
->output(OB
, Flags
);