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