1//===- NativeTypeUDT.h - info about class/struct type ------------*- 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_NATIVETYPEUDT_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEUDT_H
11
12#include "llvm/ADT/Optional.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
18namespace llvm {
19namespace pdb {
20
21class NativeTypeUDT : public NativeRawSymbol {
22public:
23  NativeTypeUDT(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
24                codeview::ClassRecord Class);
25
26  NativeTypeUDT(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
27                codeview::UnionRecord Union);
28
29  NativeTypeUDT(NativeSession &Session, SymIndexId Id,
30                NativeTypeUDT &UnmodifiedType,
31                codeview::ModifierRecord Modifier);
32
33  ~NativeTypeUDT() override;
34
35  void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
36            PdbSymbolIdField RecurseIdFields) const override;
37
38  std::string getName() const override;
39  SymIndexId getLexicalParentId() const override;
40  SymIndexId getUnmodifiedTypeId() const override;
41  SymIndexId getVirtualTableShapeId() const override;
42  uint64_t getLength() const override;
43  PDB_UdtType getUdtKind() const override;
44  bool hasConstructor() const override;
45  bool isConstType() const override;
46  bool hasAssignmentOperator() const override;
47  bool hasCastOperator() const override;
48  bool hasNestedTypes() const override;
49  bool hasOverloadedOperator() const override;
50  bool isInterfaceUdt() const override;
51  bool isIntrinsic() const override;
52  bool isNested() const override;
53  bool isPacked() const override;
54  bool isRefUdt() const override;
55  bool isScoped() const override;
56  bool isValueUdt() const override;
57  bool isUnalignedType() const override;
58  bool isVolatileType() const override;
59
60protected:
61  codeview::TypeIndex Index;
62
63  Optional<codeview::ClassRecord> Class;
64  Optional<codeview::UnionRecord> Union;
65  NativeTypeUDT *UnmodifiedType = nullptr;
66  codeview::TagRecord *Tag = nullptr;
67  Optional<codeview::ModifierRecord> Modifiers;
68};
69
70} // namespace pdb
71} // namespace llvm
72
73#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEUDT_H