1 | #include "llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h" |
2 | #include "llvm/DebugInfo/PDB/Native/NativeSession.h" |
3 | #include "llvm/DebugInfo/PDB/PDBExtras.h" |
4 | |
5 | using namespace llvm; |
6 | using namespace llvm::codeview; |
7 | using namespace llvm::pdb; |
8 | |
9 | NativeTypeTypedef::NativeTypeTypedef(NativeSession &Session, SymIndexId Id, |
10 | codeview::UDTSym Typedef) |
11 | : NativeRawSymbol(Session, PDB_SymType::Typedef, Id), |
12 | Record(std::move(Typedef)) {} |
13 | |
14 | NativeTypeTypedef::~NativeTypeTypedef() = default; |
15 | |
16 | void NativeTypeTypedef::dump(raw_ostream &OS, int Indent, |
17 | PdbSymbolIdField ShowIdFields, |
18 | PdbSymbolIdField RecurseIdFields) const { |
19 | NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields); |
20 | dumpSymbolField(OS, Name: "name" , Value: getName(), Indent); |
21 | dumpSymbolIdField(OS, Name: "typeId" , Value: getTypeId(), Indent, Session, |
22 | FieldId: PdbSymbolIdField::Type, ShowFlags: ShowIdFields, RecurseFlags: RecurseIdFields); |
23 | } |
24 | |
25 | std::string NativeTypeTypedef::getName() const { |
26 | return std::string(Record.Name); |
27 | } |
28 | |
29 | SymIndexId NativeTypeTypedef::getTypeId() const { |
30 | return Session.getSymbolCache().findSymbolByTypeIndex(TI: Record.Type); |
31 | } |
32 | |