MicrosoftDemangleNodes.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MicrosoftDemangleNodes.h ---------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines the AST nodes used in the MSVC demangler.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_DEMANGLE_MICROSOFTDEMANGLENODES_H
  18. #define LLVM_DEMANGLE_MICROSOFTDEMANGLENODES_H
  19. #include "llvm/Demangle/StringView.h"
  20. #include <array>
  21. #include <cstdint>
  22. #include <string>
  23. namespace llvm {
  24. namespace itanium_demangle {
  25. class OutputBuffer;
  26. }
  27. }
  28. using llvm::itanium_demangle::OutputBuffer;
  29. using llvm::itanium_demangle::StringView;
  30. namespace llvm {
  31. namespace ms_demangle {
  32. // Storage classes
  33. enum Qualifiers : uint8_t {
  34. Q_None = 0,
  35. Q_Const = 1 << 0,
  36. Q_Volatile = 1 << 1,
  37. Q_Far = 1 << 2,
  38. Q_Huge = 1 << 3,
  39. Q_Unaligned = 1 << 4,
  40. Q_Restrict = 1 << 5,
  41. Q_Pointer64 = 1 << 6
  42. };
  43. enum class StorageClass : uint8_t {
  44. None,
  45. PrivateStatic,
  46. ProtectedStatic,
  47. PublicStatic,
  48. Global,
  49. FunctionLocalStatic,
  50. };
  51. enum class PointerAffinity { None, Pointer, Reference, RValueReference };
  52. enum class FunctionRefQualifier { None, Reference, RValueReference };
  53. // Calling conventions
  54. enum class CallingConv : uint8_t {
  55. None,
  56. Cdecl,
  57. Pascal,
  58. Thiscall,
  59. Stdcall,
  60. Fastcall,
  61. Clrcall,
  62. Eabi,
  63. Vectorcall,
  64. Regcall,
  65. Swift, // Clang-only
  66. SwiftAsync, // Clang-only
  67. };
  68. enum class ReferenceKind : uint8_t { None, LValueRef, RValueRef };
  69. enum OutputFlags {
  70. OF_Default = 0,
  71. OF_NoCallingConvention = 1,
  72. OF_NoTagSpecifier = 2,
  73. OF_NoAccessSpecifier = 4,
  74. OF_NoMemberType = 8,
  75. OF_NoReturnType = 16,
  76. OF_NoVariableType = 32,
  77. };
  78. // Types
  79. enum class PrimitiveKind {
  80. Void,
  81. Bool,
  82. Char,
  83. Schar,
  84. Uchar,
  85. Char8,
  86. Char16,
  87. Char32,
  88. Short,
  89. Ushort,
  90. Int,
  91. Uint,
  92. Long,
  93. Ulong,
  94. Int64,
  95. Uint64,
  96. Wchar,
  97. Float,
  98. Double,
  99. Ldouble,
  100. Nullptr,
  101. };
  102. enum class CharKind {
  103. Char,
  104. Char16,
  105. Char32,
  106. Wchar,
  107. };
  108. enum class IntrinsicFunctionKind : uint8_t {
  109. None,
  110. New, // ?2 # operator new
  111. Delete, // ?3 # operator delete
  112. Assign, // ?4 # operator=
  113. RightShift, // ?5 # operator>>
  114. LeftShift, // ?6 # operator<<
  115. LogicalNot, // ?7 # operator!
  116. Equals, // ?8 # operator==
  117. NotEquals, // ?9 # operator!=
  118. ArraySubscript, // ?A # operator[]
  119. Pointer, // ?C # operator->
  120. Dereference, // ?D # operator*
  121. Increment, // ?E # operator++
  122. Decrement, // ?F # operator--
  123. Minus, // ?G # operator-
  124. Plus, // ?H # operator+
  125. BitwiseAnd, // ?I # operator&
  126. MemberPointer, // ?J # operator->*
  127. Divide, // ?K # operator/
  128. Modulus, // ?L # operator%
  129. LessThan, // ?M operator<
  130. LessThanEqual, // ?N operator<=
  131. GreaterThan, // ?O operator>
  132. GreaterThanEqual, // ?P operator>=
  133. Comma, // ?Q operator,
  134. Parens, // ?R operator()
  135. BitwiseNot, // ?S operator~
  136. BitwiseXor, // ?T operator^
  137. BitwiseOr, // ?U operator|
  138. LogicalAnd, // ?V operator&&
  139. LogicalOr, // ?W operator||
  140. TimesEqual, // ?X operator*=
  141. PlusEqual, // ?Y operator+=
  142. MinusEqual, // ?Z operator-=
  143. DivEqual, // ?_0 operator/=
  144. ModEqual, // ?_1 operator%=
  145. RshEqual, // ?_2 operator>>=
  146. LshEqual, // ?_3 operator<<=
  147. BitwiseAndEqual, // ?_4 operator&=
  148. BitwiseOrEqual, // ?_5 operator|=
  149. BitwiseXorEqual, // ?_6 operator^=
  150. VbaseDtor, // ?_D # vbase destructor
  151. VecDelDtor, // ?_E # vector deleting destructor
  152. DefaultCtorClosure, // ?_F # default constructor closure
  153. ScalarDelDtor, // ?_G # scalar deleting destructor
  154. VecCtorIter, // ?_H # vector constructor iterator
  155. VecDtorIter, // ?_I # vector destructor iterator
  156. VecVbaseCtorIter, // ?_J # vector vbase constructor iterator
  157. VdispMap, // ?_K # virtual displacement map
  158. EHVecCtorIter, // ?_L # eh vector constructor iterator
  159. EHVecDtorIter, // ?_M # eh vector destructor iterator
  160. EHVecVbaseCtorIter, // ?_N # eh vector vbase constructor iterator
  161. CopyCtorClosure, // ?_O # copy constructor closure
  162. LocalVftableCtorClosure, // ?_T # local vftable constructor closure
  163. ArrayNew, // ?_U operator new[]
  164. ArrayDelete, // ?_V operator delete[]
  165. ManVectorCtorIter, // ?__A managed vector ctor iterator
  166. ManVectorDtorIter, // ?__B managed vector dtor iterator
  167. EHVectorCopyCtorIter, // ?__C EH vector copy ctor iterator
  168. EHVectorVbaseCopyCtorIter, // ?__D EH vector vbase copy ctor iterator
  169. VectorCopyCtorIter, // ?__G vector copy constructor iterator
  170. VectorVbaseCopyCtorIter, // ?__H vector vbase copy constructor iterator
  171. ManVectorVbaseCopyCtorIter, // ?__I managed vector vbase copy constructor
  172. CoAwait, // ?__L operator co_await
  173. Spaceship, // ?__M operator<=>
  174. MaxIntrinsic
  175. };
  176. enum class SpecialIntrinsicKind {
  177. None,
  178. Vftable,
  179. Vbtable,
  180. Typeof,
  181. VcallThunk,
  182. LocalStaticGuard,
  183. StringLiteralSymbol,
  184. UdtReturning,
  185. Unknown,
  186. DynamicInitializer,
  187. DynamicAtexitDestructor,
  188. RttiTypeDescriptor,
  189. RttiBaseClassDescriptor,
  190. RttiBaseClassArray,
  191. RttiClassHierarchyDescriptor,
  192. RttiCompleteObjLocator,
  193. LocalVftable,
  194. LocalStaticThreadGuard,
  195. };
  196. // Function classes
  197. enum FuncClass : uint16_t {
  198. FC_None = 0,
  199. FC_Public = 1 << 0,
  200. FC_Protected = 1 << 1,
  201. FC_Private = 1 << 2,
  202. FC_Global = 1 << 3,
  203. FC_Static = 1 << 4,
  204. FC_Virtual = 1 << 5,
  205. FC_Far = 1 << 6,
  206. FC_ExternC = 1 << 7,
  207. FC_NoParameterList = 1 << 8,
  208. FC_VirtualThisAdjust = 1 << 9,
  209. FC_VirtualThisAdjustEx = 1 << 10,
  210. FC_StaticThisAdjust = 1 << 11,
  211. };
  212. enum class TagKind { Class, Struct, Union, Enum };
  213. enum class NodeKind {
  214. Unknown,
  215. Md5Symbol,
  216. PrimitiveType,
  217. FunctionSignature,
  218. Identifier,
  219. NamedIdentifier,
  220. VcallThunkIdentifier,
  221. LocalStaticGuardIdentifier,
  222. IntrinsicFunctionIdentifier,
  223. ConversionOperatorIdentifier,
  224. DynamicStructorIdentifier,
  225. StructorIdentifier,
  226. LiteralOperatorIdentifier,
  227. ThunkSignature,
  228. PointerType,
  229. TagType,
  230. ArrayType,
  231. Custom,
  232. IntrinsicType,
  233. NodeArray,
  234. QualifiedName,
  235. TemplateParameterReference,
  236. EncodedStringLiteral,
  237. IntegerLiteral,
  238. RttiBaseClassDescriptor,
  239. LocalStaticGuardVariable,
  240. FunctionSymbol,
  241. VariableSymbol,
  242. SpecialTableSymbol
  243. };
  244. struct Node {
  245. explicit Node(NodeKind K) : Kind(K) {}
  246. virtual ~Node() = default;
  247. NodeKind kind() const { return Kind; }
  248. virtual void output(OutputBuffer &OB, OutputFlags Flags) const = 0;
  249. std::string toString(OutputFlags Flags = OF_Default) const;
  250. private:
  251. NodeKind Kind;
  252. };
  253. struct TypeNode;
  254. struct PrimitiveTypeNode;
  255. struct FunctionSignatureNode;
  256. struct IdentifierNode;
  257. struct NamedIdentifierNode;
  258. struct VcallThunkIdentifierNode;
  259. struct IntrinsicFunctionIdentifierNode;
  260. struct LiteralOperatorIdentifierNode;
  261. struct ConversionOperatorIdentifierNode;
  262. struct StructorIdentifierNode;
  263. struct ThunkSignatureNode;
  264. struct PointerTypeNode;
  265. struct ArrayTypeNode;
  266. struct TagTypeNode;
  267. struct NodeArrayNode;
  268. struct QualifiedNameNode;
  269. struct TemplateParameterReferenceNode;
  270. struct EncodedStringLiteralNode;
  271. struct IntegerLiteralNode;
  272. struct RttiBaseClassDescriptorNode;
  273. struct LocalStaticGuardVariableNode;
  274. struct SymbolNode;
  275. struct FunctionSymbolNode;
  276. struct VariableSymbolNode;
  277. struct SpecialTableSymbolNode;
  278. struct TypeNode : public Node {
  279. explicit TypeNode(NodeKind K) : Node(K) {}
  280. virtual void outputPre(OutputBuffer &OB, OutputFlags Flags) const = 0;
  281. virtual void outputPost(OutputBuffer &OB, OutputFlags Flags) const = 0;
  282. void output(OutputBuffer &OB, OutputFlags Flags) const override {
  283. outputPre(OB, Flags);
  284. outputPost(OB, Flags);
  285. }
  286. Qualifiers Quals = Q_None;
  287. };
  288. struct PrimitiveTypeNode : public TypeNode {
  289. explicit PrimitiveTypeNode(PrimitiveKind K)
  290. : TypeNode(NodeKind::PrimitiveType), PrimKind(K) {}
  291. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  292. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override {}
  293. PrimitiveKind PrimKind;
  294. };
  295. struct FunctionSignatureNode : public TypeNode {
  296. explicit FunctionSignatureNode(NodeKind K) : TypeNode(K) {}
  297. FunctionSignatureNode() : TypeNode(NodeKind::FunctionSignature) {}
  298. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  299. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  300. // Valid if this FunctionTypeNode is the Pointee of a PointerType or
  301. // MemberPointerType.
  302. PointerAffinity Affinity = PointerAffinity::None;
  303. // The function's calling convention.
  304. CallingConv CallConvention = CallingConv::None;
  305. // Function flags (gloabl, public, etc)
  306. FuncClass FunctionClass = FC_Global;
  307. FunctionRefQualifier RefQualifier = FunctionRefQualifier::None;
  308. // The return type of the function.
  309. TypeNode *ReturnType = nullptr;
  310. // True if this is a C-style ... varargs function.
  311. bool IsVariadic = false;
  312. // Function parameters
  313. NodeArrayNode *Params = nullptr;
  314. // True if the function type is noexcept.
  315. bool IsNoexcept = false;
  316. };
  317. struct IdentifierNode : public Node {
  318. explicit IdentifierNode(NodeKind K) : Node(K) {}
  319. NodeArrayNode *TemplateParams = nullptr;
  320. protected:
  321. void outputTemplateParameters(OutputBuffer &OB, OutputFlags Flags) const;
  322. };
  323. struct VcallThunkIdentifierNode : public IdentifierNode {
  324. VcallThunkIdentifierNode() : IdentifierNode(NodeKind::VcallThunkIdentifier) {}
  325. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  326. uint64_t OffsetInVTable = 0;
  327. };
  328. struct DynamicStructorIdentifierNode : public IdentifierNode {
  329. DynamicStructorIdentifierNode()
  330. : IdentifierNode(NodeKind::DynamicStructorIdentifier) {}
  331. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  332. VariableSymbolNode *Variable = nullptr;
  333. QualifiedNameNode *Name = nullptr;
  334. bool IsDestructor = false;
  335. };
  336. struct NamedIdentifierNode : public IdentifierNode {
  337. NamedIdentifierNode() : IdentifierNode(NodeKind::NamedIdentifier) {}
  338. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  339. StringView Name;
  340. };
  341. struct IntrinsicFunctionIdentifierNode : public IdentifierNode {
  342. explicit IntrinsicFunctionIdentifierNode(IntrinsicFunctionKind Operator)
  343. : IdentifierNode(NodeKind::IntrinsicFunctionIdentifier),
  344. Operator(Operator) {}
  345. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  346. IntrinsicFunctionKind Operator;
  347. };
  348. struct LiteralOperatorIdentifierNode : public IdentifierNode {
  349. LiteralOperatorIdentifierNode()
  350. : IdentifierNode(NodeKind::LiteralOperatorIdentifier) {}
  351. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  352. StringView Name;
  353. };
  354. struct LocalStaticGuardIdentifierNode : public IdentifierNode {
  355. LocalStaticGuardIdentifierNode()
  356. : IdentifierNode(NodeKind::LocalStaticGuardIdentifier) {}
  357. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  358. bool IsThread = false;
  359. uint32_t ScopeIndex = 0;
  360. };
  361. struct ConversionOperatorIdentifierNode : public IdentifierNode {
  362. ConversionOperatorIdentifierNode()
  363. : IdentifierNode(NodeKind::ConversionOperatorIdentifier) {}
  364. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  365. // The type that this operator converts too.
  366. TypeNode *TargetType = nullptr;
  367. };
  368. struct StructorIdentifierNode : public IdentifierNode {
  369. StructorIdentifierNode() : IdentifierNode(NodeKind::StructorIdentifier) {}
  370. explicit StructorIdentifierNode(bool IsDestructor)
  371. : IdentifierNode(NodeKind::StructorIdentifier),
  372. IsDestructor(IsDestructor) {}
  373. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  374. // The name of the class that this is a structor of.
  375. IdentifierNode *Class = nullptr;
  376. bool IsDestructor = false;
  377. };
  378. struct ThunkSignatureNode : public FunctionSignatureNode {
  379. ThunkSignatureNode() : FunctionSignatureNode(NodeKind::ThunkSignature) {}
  380. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  381. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  382. struct ThisAdjustor {
  383. uint32_t StaticOffset = 0;
  384. int32_t VBPtrOffset = 0;
  385. int32_t VBOffsetOffset = 0;
  386. int32_t VtordispOffset = 0;
  387. };
  388. ThisAdjustor ThisAdjust;
  389. };
  390. struct PointerTypeNode : public TypeNode {
  391. PointerTypeNode() : TypeNode(NodeKind::PointerType) {}
  392. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  393. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  394. // Is this a pointer, reference, or rvalue-reference?
  395. PointerAffinity Affinity = PointerAffinity::None;
  396. // If this is a member pointer, this is the class that the member is in.
  397. QualifiedNameNode *ClassParent = nullptr;
  398. // Represents a type X in "a pointer to X", "a reference to X", or
  399. // "rvalue-reference to X"
  400. TypeNode *Pointee = nullptr;
  401. };
  402. struct TagTypeNode : public TypeNode {
  403. explicit TagTypeNode(TagKind Tag) : TypeNode(NodeKind::TagType), Tag(Tag) {}
  404. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  405. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  406. QualifiedNameNode *QualifiedName = nullptr;
  407. TagKind Tag;
  408. };
  409. struct ArrayTypeNode : public TypeNode {
  410. ArrayTypeNode() : TypeNode(NodeKind::ArrayType) {}
  411. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  412. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  413. void outputDimensionsImpl(OutputBuffer &OB, OutputFlags Flags) const;
  414. void outputOneDimension(OutputBuffer &OB, OutputFlags Flags, Node *N) const;
  415. // A list of array dimensions. e.g. [3,4,5] in `int Foo[3][4][5]`
  416. NodeArrayNode *Dimensions = nullptr;
  417. // The type of array element.
  418. TypeNode *ElementType = nullptr;
  419. };
  420. struct IntrinsicNode : public TypeNode {
  421. IntrinsicNode() : TypeNode(NodeKind::IntrinsicType) {}
  422. void output(OutputBuffer &OB, OutputFlags Flags) const override {}
  423. };
  424. struct CustomTypeNode : public TypeNode {
  425. CustomTypeNode() : TypeNode(NodeKind::Custom) {}
  426. void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
  427. void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
  428. IdentifierNode *Identifier = nullptr;
  429. };
  430. struct NodeArrayNode : public Node {
  431. NodeArrayNode() : Node(NodeKind::NodeArray) {}
  432. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  433. void output(OutputBuffer &OB, OutputFlags Flags, StringView Separator) const;
  434. Node **Nodes = nullptr;
  435. size_t Count = 0;
  436. };
  437. struct QualifiedNameNode : public Node {
  438. QualifiedNameNode() : Node(NodeKind::QualifiedName) {}
  439. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  440. NodeArrayNode *Components = nullptr;
  441. IdentifierNode *getUnqualifiedIdentifier() {
  442. Node *LastComponent = Components->Nodes[Components->Count - 1];
  443. return static_cast<IdentifierNode *>(LastComponent);
  444. }
  445. };
  446. struct TemplateParameterReferenceNode : public Node {
  447. TemplateParameterReferenceNode()
  448. : Node(NodeKind::TemplateParameterReference) {}
  449. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  450. SymbolNode *Symbol = nullptr;
  451. int ThunkOffsetCount = 0;
  452. std::array<int64_t, 3> ThunkOffsets;
  453. PointerAffinity Affinity = PointerAffinity::None;
  454. bool IsMemberPointer = false;
  455. };
  456. struct IntegerLiteralNode : public Node {
  457. IntegerLiteralNode() : Node(NodeKind::IntegerLiteral) {}
  458. IntegerLiteralNode(uint64_t Value, bool IsNegative)
  459. : Node(NodeKind::IntegerLiteral), Value(Value), IsNegative(IsNegative) {}
  460. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  461. uint64_t Value = 0;
  462. bool IsNegative = false;
  463. };
  464. struct RttiBaseClassDescriptorNode : public IdentifierNode {
  465. RttiBaseClassDescriptorNode()
  466. : IdentifierNode(NodeKind::RttiBaseClassDescriptor) {}
  467. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  468. uint32_t NVOffset = 0;
  469. int32_t VBPtrOffset = 0;
  470. uint32_t VBTableOffset = 0;
  471. uint32_t Flags = 0;
  472. };
  473. struct SymbolNode : public Node {
  474. explicit SymbolNode(NodeKind K) : Node(K) {}
  475. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  476. QualifiedNameNode *Name = nullptr;
  477. };
  478. struct SpecialTableSymbolNode : public SymbolNode {
  479. explicit SpecialTableSymbolNode()
  480. : SymbolNode(NodeKind::SpecialTableSymbol) {}
  481. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  482. QualifiedNameNode *TargetName = nullptr;
  483. Qualifiers Quals = Qualifiers::Q_None;
  484. };
  485. struct LocalStaticGuardVariableNode : public SymbolNode {
  486. LocalStaticGuardVariableNode()
  487. : SymbolNode(NodeKind::LocalStaticGuardVariable) {}
  488. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  489. bool IsVisible = false;
  490. };
  491. struct EncodedStringLiteralNode : public SymbolNode {
  492. EncodedStringLiteralNode() : SymbolNode(NodeKind::EncodedStringLiteral) {}
  493. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  494. StringView DecodedString;
  495. bool IsTruncated = false;
  496. CharKind Char = CharKind::Char;
  497. };
  498. struct VariableSymbolNode : public SymbolNode {
  499. VariableSymbolNode() : SymbolNode(NodeKind::VariableSymbol) {}
  500. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  501. StorageClass SC = StorageClass::None;
  502. TypeNode *Type = nullptr;
  503. };
  504. struct FunctionSymbolNode : public SymbolNode {
  505. FunctionSymbolNode() : SymbolNode(NodeKind::FunctionSymbol) {}
  506. void output(OutputBuffer &OB, OutputFlags Flags) const override;
  507. FunctionSignatureNode *Signature = nullptr;
  508. };
  509. } // namespace ms_demangle
  510. } // namespace llvm
  511. #endif
  512. #ifdef __GNUC__
  513. #pragma GCC diagnostic pop
  514. #endif