1 //===- NativeTypeFunctionSig.h - info about function signature ---*- C++-*-===//
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 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
11 
12 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
13 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
14 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
15 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
16 #include "llvm/DebugInfo/PDB/PDBTypes.h"
17 
18 namespace llvm {
19 namespace pdb {
20 
21 class NativeTypeFunctionSig : public NativeRawSymbol {
22 protected:
23   void initialize() override;
24 
25 public:
26   NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
27                         codeview::TypeIndex TI, codeview::ProcedureRecord Proc);
28 
29   NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
30                         codeview::TypeIndex TI,
31                         codeview::MemberFunctionRecord MemberFunc);
32 
33   ~NativeTypeFunctionSig() override;
34 
35   void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
36             PdbSymbolIdField RecurseIdFields) const override;
37 
38   std::unique_ptr<IPDBEnumSymbols>
39   findChildren(PDB_SymType Type) const override;
40 
41   SymIndexId getClassParentId() const override;
42   PDB_CallingConv getCallingConvention() const override;
43   uint32_t getCount() const override;
44   SymIndexId getTypeId() const override;
45   int32_t getThisAdjust() const override;
46   bool hasConstructor() const override;
47   bool isConstType() const override;
48   bool isConstructorVirtualBase() const override;
49   bool isCxxReturnUdt() const override;
50   bool isUnalignedType() const override;
51   bool isVolatileType() const override;
52 
53 private:
54   void initializeArgList(codeview::TypeIndex ArgListTI);
55 
56   union {
57     codeview::MemberFunctionRecord MemberFunc;
58     codeview::ProcedureRecord Proc;
59   };
60 
61   SymIndexId ClassParentId = 0;
62   codeview::TypeIndex Index;
63   codeview::ArgListRecord ArgList;
64   bool IsMemberFunction = false;
65 };
66 
67 } // namespace pdb
68 } // namespace llvm
69 
70 #endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
71