llvm.org GIT mirror llvm / 8d5fd87
[PDB] Make the native reader support enumerators. Previously we would dump the names of enum types, but not their enumerator values. This adds support for enumerator values. In doing so, we have to introduce a general purpose mechanism for caching symbol indices of field list members. Unlike global types, FieldList members do not have a TypeIndex. So instead, we identify them by the pair {TypeIndexOfFieldList, IndexInFieldList}. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342415 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 1 day ago
15 changed file(s) with 1402 addition(s) and 258 deletion(s). Raw diff Collapse all Expand all
2828 virtual void reset() = 0;
2929 };
3030
31 template
32 class NullEnumerator : public IPDBEnumChildren {
33 virtual uint32_t getChildCount() const override { return 0; }
34 virtual std::unique_ptr
35 getChildAtIndex(uint32_t Index) const override {
36 assert(false);
37 return nullptr;
38 }
39 virtual std::unique_ptr getNext() override {
40 assert(false);
41 return nullptr;
42 }
43 virtual void reset() override {}
44 };
45
3146 } // end namespace pdb
3247 } // end namespace llvm
3348
0 //===- NativeSymbolEnumerator.h - info about enumerator values --*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVESYMBOLENUMERATOR_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVESYMBOLENUMERATOR_H
11
12 #include "llvm/DebugInfo/CodeView/CodeView.h"
13 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
14 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
15
16 namespace llvm {
17 namespace pdb {
18 class NativeTypeEnum;
19
20 class NativeSymbolEnumerator : public NativeRawSymbol {
21 public:
22 NativeSymbolEnumerator(NativeSession &Session, SymIndexId Id,
23 const NativeTypeEnum &Parent,
24 codeview::EnumeratorRecord Record);
25
26 ~NativeSymbolEnumerator() override;
27
28 void dump(raw_ostream &OS, int Indent) const override;
29
30 SymIndexId getClassParentId() const override;
31 SymIndexId getLexicalParentId() const override;
32 std::string getName() const override;
33 SymIndexId getTypeId() const override;
34 PDB_DataKind getDataKind() const override;
35 PDB_LocType getLocationType() const override;
36 bool isConstType() const override;
37 bool isVolatileType() const override;
38 bool isUnalignedType() const override;
39 Variant getValue() const override;
40
41 protected:
42 const NativeTypeEnum &Parent;
43 codeview::EnumeratorRecord Record;
44 };
45
46 } // namespace pdb
47 } // namespace llvm
48
49 #endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H
1616
1717 namespace llvm {
1818 namespace pdb {
19
20 class NativeTypeBuiltin;
1921
2022 class NativeTypeEnum : public NativeRawSymbol {
2123 public:
5557 bool isValueUdt() const override;
5658 bool isInterfaceUdt() const override;
5759
60 const NativeTypeBuiltin &getUnderlyingBuiltinType() const;
61
5862 protected:
5963 codeview::TypeIndex Index;
6064 codeview::EnumRecord Record;
3030
3131 std::vector> Cache;
3232 DenseMap TypeIndexToSymbolId;
33 DenseMap, SymIndexId>
34 FieldListMembersToSymbolId;
3335 std::vector Compilands;
3436
3537 SymIndexId createSymbolPlaceholder() {
7678
7779 SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI);
7880
81 template
82 SymIndexId getOrCreateFieldListMember(codeview::TypeIndex FieldListTI,
83 uint32_t Index,
84 Args &&... ConstructorArgs) {
85 SymIndexId SymId = Cache.size();
86 std::pair Key{FieldListTI, Index};
87 auto Result = FieldListMembersToSymbolId.try_emplace(Key, SymId);
88 if (Result.second) {
89 auto NewSymbol = llvm::make_unique(
90 Session, SymId, std::forward(ConstructorArgs)...);
91 Cache.push_back(std::move(NewSymbol));
92 } else {
93 SymId = Result.first->second;
94 }
95 return SymId;
96 }
97
7998 std::unique_ptr getOrCreateCompiland(uint32_t Index);
8099 uint32_t getNumCompilands() const;
81100
335335 struct Variant {
336336 Variant() = default;
337337
338 explicit Variant(bool V) : Type(PDB_VariantType::Bool) { Value.Bool = V; }
339 explicit Variant(int8_t V) : Type(PDB_VariantType::Int8) { Value.Int8 = V; }
340 explicit Variant(int16_t V) : Type(PDB_VariantType::Int16) {
341 Value.Int16 = V;
342 }
343 explicit Variant(int32_t V) : Type(PDB_VariantType::Int32) {
344 Value.Int32 = V;
345 }
346 explicit Variant(int64_t V) : Type(PDB_VariantType::Int64) {
347 Value.Int64 = V;
348 }
349 explicit Variant(float V) : Type(PDB_VariantType::Single) {
350 Value.Single = V;
351 }
352 explicit Variant(double V) : Type(PDB_VariantType::Double) {
353 Value.Double = V;
354 }
355 explicit Variant(uint8_t V) : Type(PDB_VariantType::UInt8) {
356 Value.UInt8 = V;
357 }
358 explicit Variant(uint16_t V) : Type(PDB_VariantType::UInt16) {
359 Value.UInt16 = V;
360 }
361 explicit Variant(uint32_t V) : Type(PDB_VariantType::UInt32) {
362 Value.UInt32 = V;
363 }
364 explicit Variant(uint64_t V) : Type(PDB_VariantType::UInt64) {
365 Value.UInt64 = V;
366 }
367
338368 Variant(const Variant &Other) {
339369 *this = Other;
340370 }
5050 Native/NativeEnumTypes.cpp
5151 Native/NativeExeSymbol.cpp
5252 Native/NativeRawSymbol.cpp
53 Native/NativeSymbolEnumerator.cpp
5354 Native/NativeTypeBuiltin.cpp
5455 Native/NativeTypeEnum.cpp
5556 Native/NativeTypePointer.cpp
140140 return IdResult;
141141 }
142142
143 template
144 void DumpDIAValueAs(llvm::raw_ostream &OS, int Indent, StringRef Name,
145 IDiaSymbol *Symbol,
146 HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
147 ArgType Value;
148 if (S_OK == (Symbol->*Method)(&Value))
149 dumpSymbolField(OS, Name, static_cast(Value), Indent);
150 }
151
143152 template
144153 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
145154 IDiaSymbol *Symbol,
192201 #define RAW_METHOD_DUMP(Stream, Method) \
193202 DumpDIAValue(Stream, Indent, StringRef{#Method}, Symbol, \
194203 &IDiaSymbol::get_##Method);
204
205 #define RAW_METHOD_DUMP_AS(Stream, Method, Type) \
206 DumpDIAValueAs(Stream, Indent, StringRef{#Method}, Symbol, \
207 &IDiaSymbol::get_##Method);
195208
196209 void DIARawSymbol::dump(raw_ostream &OS, int Indent) const {
197210 RAW_METHOD_DUMP(OS, symIndexId);
266279 RAW_METHOD_DUMP(OS, virtualBaseDispIndex);
267280 RAW_METHOD_DUMP(OS, virtualBaseOffset);
268281 RAW_METHOD_DUMP(OS, virtualTableShapeId);
269 RAW_METHOD_DUMP(OS, dataKind);
282 RAW_METHOD_DUMP_AS(OS, dataKind, PDB_DataKind);
270283 RAW_METHOD_DUMP(OS, guid);
271284 RAW_METHOD_DUMP(OS, offset);
272285 RAW_METHOD_DUMP(OS, thisAdjust);
273286 RAW_METHOD_DUMP(OS, virtualBasePointerOffset);
274 RAW_METHOD_DUMP(OS, locationType);
287 RAW_METHOD_DUMP_AS(OS, locationType, PDB_LocType);
275288 RAW_METHOD_DUMP(OS, machineType);
276289 RAW_METHOD_DUMP(OS, thunkOrdinal);
277290 RAW_METHOD_DUMP(OS, length);
0 //===- NativeSymbolEnumerator.cpp - info about enumerators ------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h"
10
11 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
12 #include "llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h"
13 #include "llvm/DebugInfo/PDB/Native/NativeTypeEnum.h"
14
15 using namespace llvm;
16 using namespace llvm::codeview;
17 using namespace llvm::pdb;
18
19 NativeSymbolEnumerator::NativeSymbolEnumerator(
20 NativeSession &Session, SymIndexId Id, const NativeTypeEnum &Parent,
21 codeview::EnumeratorRecord Record)
22 : NativeRawSymbol(Session, PDB_SymType::Data, Id), Parent(Parent),
23 Record(std::move(Record)) {}
24
25 NativeSymbolEnumerator::~NativeSymbolEnumerator() {}
26
27 void NativeSymbolEnumerator::dump(raw_ostream &OS, int Indent) const {
28 NativeRawSymbol::dump(OS, Indent);
29 dumpSymbolField(OS, "classParentId", getClassParentId(), Indent);
30 dumpSymbolField(OS, "lexicalParentId", getLexicalParentId(), Indent);
31 dumpSymbolField(OS, "name", getName(), Indent);
32 dumpSymbolField(OS, "typeId", getTypeId(), Indent);
33 dumpSymbolField(OS, "dataKind", getDataKind(), Indent);
34 dumpSymbolField(OS, "locationType", getLocationType(), Indent);
35 dumpSymbolField(OS, "constType", isConstType(), Indent);
36 dumpSymbolField(OS, "unalignedType", isUnalignedType(), Indent);
37 dumpSymbolField(OS, "volatileType", isVolatileType(), Indent);
38 dumpSymbolField(OS, "value", getValue(), Indent);
39 }
40
41 SymIndexId NativeSymbolEnumerator::getClassParentId() const {
42 return Parent.getSymIndexId();
43 }
44
45 SymIndexId NativeSymbolEnumerator::getLexicalParentId() const { return 0; }
46
47 std::string NativeSymbolEnumerator::getName() const { return Record.Name; }
48
49 SymIndexId NativeSymbolEnumerator::getTypeId() const {
50 return Parent.getTypeId();
51 }
52
53 PDB_DataKind NativeSymbolEnumerator::getDataKind() const {
54 return PDB_DataKind::Constant;
55 }
56
57 PDB_LocType NativeSymbolEnumerator::getLocationType() const {
58 return PDB_LocType::Constant;
59 }
60
61 bool NativeSymbolEnumerator::isConstType() const { return false; }
62
63 bool NativeSymbolEnumerator::isVolatileType() const { return false; }
64
65 bool NativeSymbolEnumerator::isUnalignedType() const { return false; }
66
67 Variant NativeSymbolEnumerator::getValue() const {
68 const NativeTypeBuiltin &BT = Parent.getUnderlyingBuiltinType();
69
70 switch (BT.getBuiltinType()) {
71 case PDB_BuiltinType::Int:
72 case PDB_BuiltinType::Long:
73 case PDB_BuiltinType::Char: {
74 assert(Record.Value.isSignedIntN(BT.getLength() * 8));
75 int64_t N = Record.Value.getSExtValue();
76 switch (BT.getLength()) {
77 case 1:
78 return Variant{static_cast(N)};
79 case 2:
80 return Variant{static_cast(N)};
81 case 4:
82 return Variant{static_cast(N)};
83 case 8:
84 return Variant{static_cast(N)};
85 }
86 break;
87 }
88 case PDB_BuiltinType::UInt:
89 case PDB_BuiltinType::ULong: {
90 assert(Record.Value.isIntN(BT.getLength() * 8));
91 uint64_t U = Record.Value.getZExtValue();
92 switch (BT.getLength()) {
93 case 1:
94 return Variant{static_cast(U)};
95 case 2:
96 return Variant{static_cast(U)};
97 case 4:
98 return Variant{static_cast(U)};
99 case 8:
100 return Variant{static_cast(U)};
101 }
102 break;
103 }
104 case PDB_BuiltinType::Bool: {
105 assert(Record.Value.isIntN(BT.getLength() * 8));
106 uint64_t U = Record.Value.getZExtValue();
107 return Variant{static_cast(U)};
108 }
109 default:
110 assert(false && "Invalid enumeration type");
111 break;
112 }
113
114 return Variant{Record.Value.getSExtValue()};
115 }
1111 #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
1212 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
1313 #include "llvm/DebugInfo/PDB/Native/NativeEnumTypes.h"
14 #include "llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h"
15 #include "llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h"
16 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
1417 #include "llvm/DebugInfo/PDB/Native/SymbolCache.h"
18 #include "llvm/DebugInfo/PDB/Native/TpiStream.h"
1519 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
1620
1721 #include "llvm/Support/FormatVariadic.h"
2125 using namespace llvm;
2226 using namespace llvm::codeview;
2327 using namespace llvm::pdb;
28
29 namespace {
30 // Yea, this is a pretty terrible class name. But if we have an enum:
31 //
32 // enum Foo {
33 // A,
34 // B
35 // };
36 //
37 // then A and B are the "enumerators" of the "enum" Foo. And we need
38 // to enumerate them.
39 class NativeEnumEnumEnumerators : public IPDBEnumSymbols, TypeVisitorCallbacks {
40 public:
41 NativeEnumEnumEnumerators(NativeSession &Session,
42 const NativeTypeEnum &ClassParent,
43 const codeview::EnumRecord &CVEnum);
44
45 uint32_t getChildCount() const override;
46 std::unique_ptr getChildAtIndex(uint32_t Index) const override;
47 std::unique_ptr getNext() override;
48 void reset() override;
49
50 private:
51 Error visitKnownMember(CVMemberRecord &CVM,
52 EnumeratorRecord &Record) override;
53 Error visitKnownMember(CVMemberRecord &CVM,
54 ListContinuationRecord &Record) override;
55
56 NativeSession &Session;
57 const NativeTypeEnum &ClassParent;
58 const codeview::EnumRecord &CVEnum;
59 std::vector Enumerators;
60 Optional ContinuationIndex;
61 uint32_t Index = 0;
62 };
63 } // namespace
64
65 NativeEnumEnumEnumerators::NativeEnumEnumEnumerators(
66 NativeSession &Session, const NativeTypeEnum &ClassParent,
67 const codeview::EnumRecord &CVEnum)
68 : Session(Session), ClassParent(ClassParent), CVEnum(CVEnum) {
69 TpiStream &Tpi = cantFail(Session.getPDBFile().getPDBTpiStream());
70 LazyRandomTypeCollection &Types = Tpi.typeCollection();
71
72 ContinuationIndex = CVEnum.FieldList;
73 while (ContinuationIndex) {
74 CVType FieldList = Types.getType(*ContinuationIndex);
75 assert(FieldList.kind() == LF_FIELDLIST);
76 ContinuationIndex.reset();
77 cantFail(visitMemberRecordStream(FieldList.data(), *this));
78 }
79 }
80
81 Error NativeEnumEnumEnumerators::visitKnownMember(CVMemberRecord &CVM,
82 EnumeratorRecord &Record) {
83 Enumerators.push_back(Record);
84 return Error::success();
85 }
86
87 Error NativeEnumEnumEnumerators::visitKnownMember(
88 CVMemberRecord &CVM, ListContinuationRecord &Record) {
89 ContinuationIndex = Record.ContinuationIndex;
90 return Error::success();
91 }
92
93 uint32_t NativeEnumEnumEnumerators::getChildCount() const {
94 return Enumerators.size();
95 }
96
97 std::unique_ptr
98 NativeEnumEnumEnumerators::getChildAtIndex(uint32_t Index) const {
99 if (Index >= getChildCount())
100 return nullptr;
101
102 SymIndexId Id =
103 Session.getSymbolCache()
104 .getOrCreateFieldListMember(
105 CVEnum.FieldList, Index, ClassParent, Enumerators[Index]);
106 return Session.getSymbolCache().getSymbolById(Id);
107 }
108
109 std::unique_ptr NativeEnumEnumEnumerators::getNext() {
110 if (Index >= getChildCount())
111 return nullptr;
112
113 return getChildAtIndex(Index++);
114 }
115
116 void NativeEnumEnumEnumerators::reset() { Index = 0; }
24117
25118 NativeTypeEnum::NativeTypeEnum(NativeSession &Session, SymIndexId Id,
26119 TypeIndex Index, EnumRecord Record)
66159
67160 std::unique_ptr
68161 NativeTypeEnum::findChildren(PDB_SymType Type) const {
69 switch (Type) {
70 case PDB_SymType::Data: {
71 // TODO(amccarth) : Provide an actual implementation.
72 return nullptr;
162 if (Type != PDB_SymType::Data)
163 return llvm::make_unique>();
164
165 const NativeTypeEnum *ClassParent = nullptr;
166 if (!Modifiers)
167 ClassParent = this;
168 else {
169 NativeRawSymbol &NRS =
170 Session.getSymbolCache().getNativeSymbolById(getUnmodifiedTypeId());
171 assert(NRS.getSymTag() == PDB_SymType::Enum);
172 ClassParent = static_cast(&NRS);
73173 }
74 default:
75 return nullptr;
76 }
174 return llvm::make_unique(Session, *ClassParent,
175 Record);
77176 }
78177
79178 PDB_SymType NativeTypeEnum::getSymTag() const { return PDB_SymType::Enum; }
85184
86185 // This indicates a corrupt record.
87186 if (!Underlying.isSimple() ||
88 Underlying.getSimpleMode() != SimpleTypeMode::Direct)
187 Underlying.getSimpleMode() != SimpleTypeMode::Direct) {
89188 return PDB_BuiltinType::None;
189 }
90190
91191 switch (Underlying.getSimpleKind()) {
92192 case SimpleTypeKind::Boolean128:
97197 return PDB_BuiltinType::Bool;
98198 case SimpleTypeKind::NarrowCharacter:
99199 case SimpleTypeKind::UnsignedCharacter:
200 case SimpleTypeKind::SignedCharacter:
100201 return PDB_BuiltinType::Char;
101202 case SimpleTypeKind::WideCharacter:
102203 return PDB_BuiltinType::WCharT;
148249 SymIndexId NativeTypeEnum::getUnmodifiedTypeId() const {
149250 if (!Modifiers)
150251 return 0;
252
151253 return Session.getSymbolCache().findSymbolByTypeIndex(
152254 Modifiers->ModifiedType);
153255 }
234336 return ((Modifiers->getModifiers() & ModifierOptions::Unaligned) !=
235337 ModifierOptions::None);
236338 }
339
340 const NativeTypeBuiltin &NativeTypeEnum::getUnderlyingBuiltinType() const {
341 return Session.getSymbolCache().getNativeSymbolById(
342 getTypeId());
343 }
2525 PDB_BuiltinType Type;
2626 uint32_t Size;
2727 } BuiltinTypes[] = {
28 {codeview::SimpleTypeKind::Int16Short, PDB_BuiltinType::Int, 2},
29 {codeview::SimpleTypeKind::UInt16Short, PDB_BuiltinType::UInt, 2},
2830 {codeview::SimpleTypeKind::Int32, PDB_BuiltinType::Int, 4},
2931 {codeview::SimpleTypeKind::UInt32, PDB_BuiltinType::UInt, 4},
32 {codeview::SimpleTypeKind::Int32Long, PDB_BuiltinType::Int, 4},
3033 {codeview::SimpleTypeKind::UInt32Long, PDB_BuiltinType::UInt, 4},
34 {codeview::SimpleTypeKind::Int64Quad, PDB_BuiltinType::Int, 8},
3135 {codeview::SimpleTypeKind::UInt64Quad, PDB_BuiltinType::UInt, 8},
3236 {codeview::SimpleTypeKind::NarrowCharacter, PDB_BuiltinType::Char, 1},
3337 {codeview::SimpleTypeKind::SignedCharacter, PDB_BuiltinType::Char, 1},
3438 {codeview::SimpleTypeKind::UnsignedCharacter, PDB_BuiltinType::UInt, 1},
35 {codeview::SimpleTypeKind::UInt16Short, PDB_BuiltinType::UInt, 2},
3639 {codeview::SimpleTypeKind::Boolean8, PDB_BuiltinType::Bool, 1}
3740 // This table can be grown as necessary, but these are the only types we've
3841 // needed so far.
168171
169172 std::unique_ptr
170173 SymbolCache::getSymbolById(SymIndexId SymbolId) const {
174 assert(SymbolId < Cache.size());
175
171176 // Id 0 is reserved.
172177 if (SymbolId == 0)
173178 return nullptr;
292292 OS << Value.Value.Single;
293293 break;
294294 case PDB_VariantType::UInt16:
295 OS << Value.Value.Double;
295 OS << Value.Value.UInt16;
296296 break;
297297 case PDB_VariantType::UInt32:
298298 OS << Value.Value.UInt32;
0 // Build with "cl.exe /Zi /GR- /GX- every-enum.cpp /link /debug /nodefaultlib /incremental:no /entry:main"
1
2 #include
3
4 // clang-format off
5 void *__purecall = 0;
6
7 void __cdecl operator delete(void *,unsigned int) {}
8 void __cdecl operator delete(void *,unsigned __int64) {}
9
10
11 enum I8 : int8_t {
12 I8A = INT8_MIN,
13 I8B = 0,
14 I8C = INT8_MAX
15 };
16
17 enum I16 : int16_t {
18 I16A = INT16_MIN,
19 I16B = 0,
20 I16C = INT16_MAX,
21 };
22
23 enum I32 : int32_t {
24 I32A = INT32_MIN,
25 I32B = 0,
26 I32C = INT32_MAX,
27 };
28
29 enum I64 : int64_t {
30 I64A = INT64_MIN,
31 I64B = 0,
32 I64C = INT64_MAX,
33 };
34
35 enum U8 : uint8_t {
36 U8A = 0,
37 U8B = UINT8_MAX
38 };
39
40 enum U16 : uint16_t {
41 U16A = 0,
42 U16B = UINT16_MAX,
43 };
44
45 enum U32 : uint32_t {
46 U32A = 0,
47 U32B = UINT32_MAX,
48 };
49
50 enum U64 : uint64_t {
51 U64A = 0,
52 U64B = UINT64_MAX,
53 };
54
55 enum Char16 : char16_t {
56 C16A = u'a',
57 C16B = u'b',
58 };
59
60 enum Char32 : char32_t {
61 C32A = U'a',
62 C32B = U'b',
63 };
64
65 enum WChar : wchar_t {
66 WCA = L'a',
67 WCB = L'b',
68 };
69
70 enum Bool : bool {
71 BA = true,
72 BB = false
73 };
74
75 enum class EC {
76 A = 1,
77 B = 2
78 };
79
80 struct Struct {
81 enum Nested {
82 A = 1,
83 B = 2
84 };
85 };
86
87 template void f(T t) {}
88
89 int main(int argc, char **argv) {
90 f(I8A);
91 f(I16A);
92 f(I32A);
93 f(I64A);
94 f(U8A);
95 f(U16A);
96 f(U32A);
97 f(U64A);
98
99 f(C16A);
100 f(C32A);
101 f(WCA);
102 f(BA);
103
104
105 f(EC::A);
106 f(Struct::A);
107
108 f(EC::A);
109 }
None ; Test that the native PDB reader can enumerate the enum types.
1 ; RUN: llvm-pdbutil pretty -native -enums %p/../Inputs/every-type.pdb \
0 ; Test that the native PDB reader can enumerate the enum types. The output
1 ; being checked against is golden output generated by llvm-pdbutil without
2 ; the -native flag. Then we check that we generate the same output.
3 ; Unfortunately since we generate a slightly different (albeit correct)
4 ; class / parent hierarchy, if you re-generate this file you will need to
5 ; actually use the output from llvm-pdbutil *with* the -native flag, but
6 ; before "blessing" it, manually diff against the golden output from
7 ; llvm-pdbutil without the -native flag and verifying that there are no
8 ; substantive differences aside from the various symbol ids.
9
10 ; RUN: llvm-pdbutil pretty -native -enums %p/../Inputs/every-enum.pdb \
211 ; RUN: | FileCheck -check-prefix=ENUMS %s
3 ; RUN: llvm-pdbutil diadump -native -enums %p/../Inputs/every-type.pdb \
12 ; RUN: llvm-pdbutil diadump -native -enums %p/../Inputs/every-enum.pdb \
413 ; RUN: | FileCheck -check-prefix=DUMP %s
514
6 ENUMS: enum FooClass::NestedEnum {
7 ENUMS-NEXT: }
8 ENUMS: const volatile enum FooClass::NestedEnum
915
10 DUMP: {
11 DUMP-NEXT: symIndexId: 2
12 DUMP-NEXT: symTag: 12
13 DUMP-NEXT: baseType: 6
14 DUMP-NEXT: lexicalParentId: 0
15 DUMP-NEXT: name: FooClass::NestedEnum
16 DUMP-NEXT: typeId: 3
17 DUMP-NEXT: length: 4
18 DUMP-NEXT: constructor: 0
19 DUMP-NEXT: constType: 0
20 DUMP-NEXT: hasAssignmentOperator: 0
21 DUMP-NEXT: hasCastOperator: 0
22 DUMP-NEXT: hasNestedTypes: 0
23 DUMP-NEXT: overloadedOperator: 0
24 DUMP-NEXT: isInterfaceUdt: 0
25 DUMP-NEXT: intrinsic: 0
26 DUMP-NEXT: nested: 1
27 DUMP-NEXT: packed: 0
28 DUMP-NEXT: isRefUdt: 0
29 DUMP-NEXT: scoped: 0
30 DUMP-NEXT: unalignedType: 0
31 DUMP-NEXT: isValueUdt: 0
32 DUMP-NEXT: volatileType: 0
33 DUMP-NEXT: }
34 DUMP-NEXT: {
35 DUMP-NEXT: symIndexId: 4
36 DUMP-NEXT: symTag: 12
37 DUMP-NEXT: baseType: 6
38 DUMP-NEXT: lexicalParentId: 0
39 DUMP-NEXT: name: __vc_attributes::event_sourceAttribute::type_e
40 DUMP-NEXT: typeId: 3
41 DUMP-NEXT: length: 4
42 DUMP-NEXT: constructor: 0
43 DUMP-NEXT: constType: 0
44 DUMP-NEXT: hasAssignmentOperator: 0
45 DUMP-NEXT: hasCastOperator: 0
46 DUMP-NEXT: hasNestedTypes: 0
47 DUMP-NEXT: overloadedOperator: 0
48 DUMP-NEXT: isInterfaceUdt: 0
49 DUMP-NEXT: intrinsic: 0
50 DUMP-NEXT: nested: 1
51 DUMP-NEXT: packed: 0
52 DUMP-NEXT: isRefUdt: 0
53 DUMP-NEXT: scoped: 0
54 DUMP-NEXT: unalignedType: 0
55 DUMP-NEXT: isValueUdt: 0
56 DUMP-NEXT: volatileType: 0
57 DUMP-NEXT: }
58 DUMP-NEXT: {
59 DUMP-NEXT: symIndexId: 5
60 DUMP-NEXT: symTag: 12
61 DUMP-NEXT: baseType: 6
62 DUMP-NEXT: lexicalParentId: 0
63 DUMP-NEXT: name: __vc_attributes::event_sourceAttribute::optimize_e
64 DUMP-NEXT: typeId: 3
65 DUMP-NEXT: length: 4
66 DUMP-NEXT: constructor: 0
67 DUMP-NEXT: constType: 0
68 DUMP-NEXT: hasAssignmentOperator: 0
69 DUMP-NEXT: hasCastOperator: 0
70 DUMP-NEXT: hasNestedTypes: 0
71 DUMP-NEXT: overloadedOperator: 0
72 DUMP-NEXT: isInterfaceUdt: 0
73 DUMP-NEXT: intrinsic: 0
74 DUMP-NEXT: nested: 1
75 DUMP-NEXT: packed: 0
76 DUMP-NEXT: isRefUdt: 0
77 DUMP-NEXT: scoped: 0
78 DUMP-NEXT: unalignedType: 0
79 DUMP-NEXT: isValueUdt: 0
80 DUMP-NEXT: volatileType: 0
81 DUMP-NEXT: }
82 DUMP-NEXT: {
83 DUMP-NEXT: symIndexId: 6
84 DUMP-NEXT: symTag: 12
85 DUMP-NEXT: baseType: 6
86 DUMP-NEXT: lexicalParentId: 0
87 DUMP-NEXT: name: __vc_attributes::helper_attributes::v1_alttypeAttribute::type_e
88 DUMP-NEXT: typeId: 3
89 DUMP-NEXT: length: 4
90 DUMP-NEXT: constructor: 0
91 DUMP-NEXT: constType: 0
92 DUMP-NEXT: hasAssignmentOperator: 0
93 DUMP-NEXT: hasCastOperator: 0
94 DUMP-NEXT: hasNestedTypes: 0
95 DUMP-NEXT: overloadedOperator: 0
96 DUMP-NEXT: isInterfaceUdt: 0
97 DUMP-NEXT: intrinsic: 0
98 DUMP-NEXT: nested: 1
99 DUMP-NEXT: packed: 0
100 DUMP-NEXT: isRefUdt: 0
101 DUMP-NEXT: scoped: 0
102 DUMP-NEXT: unalignedType: 0
103 DUMP-NEXT: isValueUdt: 0
104 DUMP-NEXT: volatileType: 0
105 DUMP-NEXT: }
106 DUMP-NEXT: {
107 DUMP-NEXT: symIndexId: 7
108 DUMP-NEXT: symTag: 12
109 DUMP-NEXT: baseType: 6
110 DUMP-NEXT: lexicalParentId: 0
111 DUMP-NEXT: name: __vc_attributes::helper_attributes::usageAttribute::usage_e
112 DUMP-NEXT: typeId: 3
113 DUMP-NEXT: length: 4
114 DUMP-NEXT: constructor: 0
115 DUMP-NEXT: constType: 0
116 DUMP-NEXT: hasAssignmentOperator: 0
117 DUMP-NEXT: hasCastOperator: 0
118 DUMP-NEXT: hasNestedTypes: 0
119 DUMP-NEXT: overloadedOperator: 0
120 DUMP-NEXT: isInterfaceUdt: 0
121 DUMP-NEXT: intrinsic: 0
122 DUMP-NEXT: nested: 1
123 DUMP-NEXT: packed: 0
124 DUMP-NEXT: isRefUdt: 0
125 DUMP-NEXT: scoped: 0
126 DUMP-NEXT: unalignedType: 0
127 DUMP-NEXT: isValueUdt: 0
128 DUMP-NEXT: volatileType: 0
129 DUMP-NEXT: }
130 DUMP-NEXT: {
131 DUMP-NEXT: symIndexId: 8
132 DUMP-NEXT: symTag: 12
133 DUMP-NEXT: baseType: 6
134 DUMP-NEXT: lexicalParentId: 0
135 DUMP-NEXT: name: __vc_attributes::threadingAttribute::threading_e
136 DUMP-NEXT: typeId: 3
137 DUMP-NEXT: length: 4
138 DUMP-NEXT: constructor: 0
139 DUMP-NEXT: constType: 0
140 DUMP-NEXT: hasAssignmentOperator: 0
141 DUMP-NEXT: hasCastOperator: 0
142 DUMP-NEXT: hasNestedTypes: 0
143 DUMP-NEXT: overloadedOperator: 0
144 DUMP-NEXT: isInterfaceUdt: 0
145 DUMP-NEXT: intrinsic: 0
146 DUMP-NEXT: nested: 1
147 DUMP-NEXT: packed: 0
148 DUMP-NEXT: isRefUdt: 0
149 DUMP-NEXT: scoped: 0
150 DUMP-NEXT: unalignedType: 0
151 DUMP-NEXT: isValueUdt: 0
152 DUMP-NEXT: volatileType: 0
153 DUMP-NEXT: }
154 DUMP-NEXT: {
155 DUMP-NEXT: symIndexId: 9
156 DUMP-NEXT: symTag: 12
157 DUMP-NEXT: baseType: 6
158 DUMP-NEXT: lexicalParentId: 0
159 DUMP-NEXT: name: __vc_attributes::aggregatableAttribute::type_e
160 DUMP-NEXT: typeId: 3
161 DUMP-NEXT: length: 4
162 DUMP-NEXT: constructor: 0
163 DUMP-NEXT: constType: 0
164 DUMP-NEXT: hasAssignmentOperator: 0
165 DUMP-NEXT: hasCastOperator: 0
166 DUMP-NEXT: hasNestedTypes: 0
167 DUMP-NEXT: overloadedOperator: 0
168 DUMP-NEXT: isInterfaceUdt: 0
169 DUMP-NEXT: intrinsic: 0
170 DUMP-NEXT: nested: 1
171 DUMP-NEXT: packed: 0
172 DUMP-NEXT: isRefUdt: 0
173 DUMP-NEXT: scoped: 0
174 DUMP-NEXT: unalignedType: 0
175 DUMP-NEXT: isValueUdt: 0
176 DUMP-NEXT: volatileType: 0
177 DUMP-NEXT: }
178 DUMP-NEXT: {
179 DUMP-NEXT: symIndexId: 10
180 DUMP-NEXT: symTag: 12
181 DUMP-NEXT: baseType: 6
182 DUMP-NEXT: lexicalParentId: 0
183 DUMP-NEXT: name: __vc_attributes::event_receiverAttribute::type_e
184 DUMP-NEXT: typeId: 3
185 DUMP-NEXT: length: 4
186 DUMP-NEXT: constructor: 0
187 DUMP-NEXT: constType: 0
188 DUMP-NEXT: hasAssignmentOperator: 0
189 DUMP-NEXT: hasCastOperator: 0
190 DUMP-NEXT: hasNestedTypes: 0
191 DUMP-NEXT: overloadedOperator: 0
192 DUMP-NEXT: isInterfaceUdt: 0
193 DUMP-NEXT: intrinsic: 0
194 DUMP-NEXT: nested: 1
195 DUMP-NEXT: packed: 0
196 DUMP-NEXT: isRefUdt: 0
197 DUMP-NEXT: scoped: 0
198 DUMP-NEXT: unalignedType: 0
199 DUMP-NEXT: isValueUdt: 0
200 DUMP-NEXT: volatileType: 0
201 DUMP-NEXT: }
202 DUMP-NEXT: {
203 DUMP-NEXT: symIndexId: 11
204 DUMP-NEXT: symTag: 12
205 DUMP-NEXT: baseType: 6
206 DUMP-NEXT: lexicalParentId: 0
207 DUMP-NEXT: name: __vc_attributes::moduleAttribute::type_e
208 DUMP-NEXT: typeId: 3
209 DUMP-NEXT: length: 4
210 DUMP-NEXT: constructor: 0
211 DUMP-NEXT: constType: 0
212 DUMP-NEXT: hasAssignmentOperator: 0
213 DUMP-NEXT: hasCastOperator: 0
214 DUMP-NEXT: hasNestedTypes: 0
215 DUMP-NEXT: overloadedOperator: 0
216 DUMP-NEXT: isInterfaceUdt: 0
217 DUMP-NEXT: intrinsic: 0
218 DUMP-NEXT: nested: 1
219 DUMP-NEXT: packed: 0
220 DUMP-NEXT: isRefUdt: 0
221 DUMP-NEXT: scoped: 0
222 DUMP-NEXT: unalignedType: 0
223 DUMP-NEXT: isValueUdt: 0
224 DUMP-NEXT: volatileType: 0
225 DUMP-NEXT: }
226 DUMP-NEXT: {
227 DUMP-NEXT: symIndexId: 12
228 DUMP-NEXT: symTag: 12
229 DUMP-NEXT: baseType: 6
230 DUMP-NEXT: lexicalParentId: 0
231 DUMP-NEXT: name: FooClass::NestedEnum
232 DUMP-NEXT: typeId: 3
233 DUMP-NEXT: length: 4
234 DUMP-NEXT: constructor: 0
235 DUMP-NEXT: constType: 1
236 DUMP-NEXT: hasAssignmentOperator: 0
237 DUMP-NEXT: hasCastOperator: 0
238 DUMP-NEXT: hasNestedTypes: 0
239 DUMP-NEXT: overloadedOperator: 0
240 DUMP-NEXT: isInterfaceUdt: 0
241 DUMP-NEXT: intrinsic: 0
242 DUMP-NEXT: nested: 1
243 DUMP-NEXT: packed: 0
244 DUMP-NEXT: isRefUdt: 0
245 DUMP-NEXT: scoped: 0
246 DUMP-NEXT: unalignedType: 0
247 DUMP-NEXT: isValueUdt: 0
248 DUMP-NEXT: volatileType: 1
249 DUMP-NEXT: }
16 ENUMS: enum I8 : char {
17 ENUMS: I8A = -128
18 ENUMS: I8B = 0
19 ENUMS: I8C = 127
20 ENUMS: }
21 ENUMS: enum I16 : short {
22 ENUMS: I16A = -32768
23 ENUMS: I16B = 0
24 ENUMS: I16C = 32767
25 ENUMS: }
26 ENUMS: enum I32 {
27 ENUMS: I32A = -2147483648
28 ENUMS: I32B = 0
29 ENUMS: I32C = 2147483647
30 ENUMS: }
31 ENUMS: enum I64 : __int64 {
32 ENUMS: I64A = -9223372036854775808
33 ENUMS: I64B = 0
34 ENUMS: I64C = 9223372036854775807
35 ENUMS: }
36 ENUMS: enum U8 : unsigned char {
37 ENUMS: U8A = 0
38 ENUMS: U8B = 255
39 ENUMS: }
40 ENUMS: enum U16 : unsigned short {
41 ENUMS: U16A = 0
42 ENUMS: U16B = 65535
43 ENUMS: }
44 ENUMS: enum U32 : unsigned int {
45 ENUMS: U32A = 0
46 ENUMS: U32B = 4294967295
47 ENUMS: }
48 ENUMS: enum U64 : unsigned __int64 {
49 ENUMS: U64A = 0
50 ; FIXME: This should be UINT64_MAX. Is the compiler encoding it wrong or
51 ; are we decoding it wrong?
52 ENUMS: U64B = 255
53 ENUMS: }
54 ENUMS: enum Char16 : unsigned short {
55 ENUMS: C16A = 97
56 ENUMS: C16B = 98
57 ENUMS: }
58 ENUMS: enum Char32 : unsigned int {
59 ENUMS: C32A = 97
60 ENUMS: C32B = 98
61 ENUMS: }
62 ENUMS: enum WChar : unsigned short {
63 ENUMS: WCA = 97
64 ENUMS: WCB = 98
65 ENUMS: }
66 ENUMS: enum Bool : bool {
67 ENUMS: BA = true
68 ENUMS: BB = false
69 ENUMS: }
70 ENUMS: enum EC {
71 ENUMS: A = 1
72 ENUMS: B = 2
73 ENUMS: }
74 ENUMS: enum Struct::Nested {
75 ENUMS: A = 1
76 ENUMS: B = 2
77 ENUMS: }
78 ENUMS: const volatile enum EC
79
80
81 DUMP: {
82 DUMP: symIndexId: 2
83 DUMP: symTag: 12
84 DUMP: baseType: 2
85 DUMP: lexicalParentId: 0
86 DUMP: name: I8
87 DUMP: typeId: 3
88 DUMP: length: 1
89 DUMP: constructor: 0
90 DUMP: constType: 0
91 DUMP: hasAssignmentOperator: 0
92 DUMP: hasCastOperator: 0
93 DUMP: hasNestedTypes: 0
94 DUMP: overloadedOperator: 0
95 DUMP: isInterfaceUdt: 0
96 DUMP: intrinsic: 0
97 DUMP: nested: 0
98 DUMP: packed: 0
99 DUMP: isRefUdt: 0
100 DUMP: scoped: 0
101 DUMP: unalignedType: 0
102 DUMP: isValueUdt: 0
103 DUMP: volatileType: 0
104 DUMP: {
105 DUMP: symIndexId: 4
106 DUMP: symTag: 7
107 DUMP: classParentId: 2
108 DUMP: lexicalParentId: 0
109 DUMP: name: I8A
110 DUMP: typeId: 3
111 DUMP: dataKind: const
112 DUMP: locationType: constant
113 DUMP: constType: 0
114 DUMP: unalignedType: 0
115 DUMP: volatileType: 0
116 DUMP: value: -128
117 DUMP: }
118 DUMP: {
119 DUMP: symIndexId: 5
120 DUMP: symTag: 7
121 DUMP: classParentId: 2
122 DUMP: lexicalParentId: 0
123 DUMP: name: I8B
124 DUMP: typeId: 3
125 DUMP: dataKind: const
126 DUMP: locationType: constant
127 DUMP: constType: 0
128 DUMP: unalignedType: 0
129 DUMP: volatileType: 0
130 DUMP: value: 0
131 DUMP: }
132 DUMP: {
133 DUMP: symIndexId: 6
134 DUMP: symTag: 7
135 DUMP: classParentId: 2
136 DUMP: lexicalParentId: 0
137 DUMP: name: I8C
138 DUMP: typeId: 3
139 DUMP: dataKind: const
140 DUMP: locationType: constant
141 DUMP: constType: 0
142 DUMP: unalignedType: 0
143 DUMP: volatileType: 0
144 DUMP: value: 127
145 DUMP: }
146 DUMP: }
147 DUMP: {
148 DUMP: symIndexId: 7
149 DUMP: symTag: 12
150 DUMP: baseType: 6
151 DUMP: lexicalParentId: 0
152 DUMP: name: I16
153 DUMP: typeId: 8
154 DUMP: length: 2
155 DUMP: constructor: 0
156 DUMP: constType: 0
157 DUMP: hasAssignmentOperator: 0
158 DUMP: hasCastOperator: 0
159 DUMP: hasNestedTypes: 0
160 DUMP: overloadedOperator: 0
161 DUMP: isInterfaceUdt: 0
162 DUMP: intrinsic: 0
163 DUMP: nested: 0
164 DUMP: packed: 0
165 DUMP: isRefUdt: 0
166 DUMP: scoped: 0
167 DUMP: unalignedType: 0
168 DUMP: isValueUdt: 0
169 DUMP: volatileType: 0
170 DUMP: {
171 DUMP: symIndexId: 9
172 DUMP: symTag: 7
173 DUMP: classParentId: 7
174 DUMP: lexicalParentId: 0
175 DUMP: name: I16A
176 DUMP: typeId: 8
177 DUMP: dataKind: const
178 DUMP: locationType: constant
179 DUMP: constType: 0
180 DUMP: unalignedType: 0
181 DUMP: volatileType: 0
182 DUMP: value: -32768
183 DUMP: }
184 DUMP: {
185 DUMP: symIndexId: 10
186 DUMP: symTag: 7
187 DUMP: classParentId: 7
188 DUMP: lexicalParentId: 0
189 DUMP: name: I16B
190 DUMP: typeId: 8
191 DUMP: dataKind: const
192 DUMP: locationType: constant
193 DUMP: constType: 0
194 DUMP: unalignedType: 0
195 DUMP: volatileType: 0
196 DUMP: value: 0
197 DUMP: }
198 DUMP: {
199 DUMP: symIndexId: 11
200 DUMP: symTag: 7
201 DUMP: classParentId: 7
202 DUMP: lexicalParentId: 0
203 DUMP: name: I16C
204 DUMP: typeId: 8
205 DUMP: dataKind: const
206 DUMP: locationType: constant
207 DUMP: constType: 0
208 DUMP: unalignedType: 0
209 DUMP: volatileType: 0
210 DUMP: value: 32767
211 DUMP: }
212 DUMP: }
213 DUMP: {
214 DUMP: symIndexId: 12
215 DUMP: symTag: 12
216 DUMP: baseType: 6
217 DUMP: lexicalParentId: 0
218 DUMP: name: I32
219 DUMP: typeId: 13
220 DUMP: length: 4
221 DUMP: constructor: 0
222 DUMP: constType: 0
223 DUMP: hasAssignmentOperator: 0
224 DUMP: hasCastOperator: 0
225 DUMP: hasNestedTypes: 0
226 DUMP: overloadedOperator: 0
227 DUMP: isInterfaceUdt: 0
228 DUMP: intrinsic: 0
229 DUMP: nested: 0
230 DUMP: packed: 0
231 DUMP: isRefUdt: 0
232 DUMP: scoped: 0
233 DUMP: unalignedType: 0
234 DUMP: isValueUdt: 0
235 DUMP: volatileType: 0
236 DUMP: {
237 DUMP: symIndexId: 14
238 DUMP: symTag: 7
239 DUMP: classParentId: 12
240 DUMP: lexicalParentId: 0
241 DUMP: name: I32A
242 DUMP: typeId: 13
243 DUMP: dataKind: const
244 DUMP: locationType: constant
245 DUMP: constType: 0
246 DUMP: unalignedType: 0
247 DUMP: volatileType: 0
248 DUMP: value: -2147483648
249 DUMP: }
250 DUMP: {
251 DUMP: symIndexId: 15
252 DUMP: symTag: 7
253 DUMP: classParentId: 12
254 DUMP: lexicalParentId: 0
255 DUMP: name: I32B
256 DUMP: typeId: 13
257 DUMP: dataKind: const
258 DUMP: locationType: constant
259 DUMP: constType: 0
260 DUMP: unalignedType: 0
261 DUMP: volatileType: 0
262 DUMP: value: 0
263 DUMP: }
264 DUMP: {
265 DUMP: symIndexId: 16
266 DUMP: symTag: 7
267 DUMP: classParentId: 12
268 DUMP: lexicalParentId: 0
269 DUMP: name: I32C
270 DUMP: typeId: 13
271 DUMP: dataKind: const
272 DUMP: locationType: constant
273 DUMP: constType: 0
274 DUMP: unalignedType: 0
275 DUMP: volatileType: 0
276 DUMP: value: 2147483647
277 DUMP: }
278 DUMP: }
279 DUMP: {
280 DUMP: symIndexId: 17
281 DUMP: symTag: 12
282 DUMP: baseType: 6
283 DUMP: lexicalParentId: 0
284 DUMP: name: I64
285 DUMP: typeId: 18
286 DUMP: length: 8
287 DUMP: constructor: 0
288 DUMP: constType: 0
289 DUMP: hasAssignmentOperator: 0
290 DUMP: hasCastOperator: 0
291 DUMP: hasNestedTypes: 0
292 DUMP: overloadedOperator: 0
293 DUMP: isInterfaceUdt: 0
294 DUMP: intrinsic: 0
295 DUMP: nested: 0
296 DUMP: packed: 0
297 DUMP: isRefUdt: 0
298 DUMP: scoped: 0
299 DUMP: unalignedType: 0
300 DUMP: isValueUdt: 0
301 DUMP: volatileType: 0
302 DUMP: {
303 DUMP: symIndexId: 19
304 DUMP: symTag: 7
305 DUMP: classParentId: 17
306 DUMP: lexicalParentId: 0
307 DUMP: name: I64A
308 DUMP: typeId: 18
309 DUMP: dataKind: const
310 DUMP: locationType: constant
311 DUMP: constType: 0
312 DUMP: unalignedType: 0
313 DUMP: volatileType: 0
314 DUMP: value: -9223372036854775808
315 DUMP: }
316 DUMP: {
317 DUMP: symIndexId: 20
318 DUMP: symTag: 7
319 DUMP: classParentId: 17
320 DUMP: lexicalParentId: 0
321 DUMP: name: I64B
322 DUMP: typeId: 18
323 DUMP: dataKind: const
324 DUMP: locationType: constant
325 DUMP: constType: 0
326 DUMP: unalignedType: 0
327 DUMP: volatileType: 0
328 DUMP: value: 0
329 DUMP: }
330 DUMP: {
331 DUMP: symIndexId: 21
332 DUMP: symTag: 7
333 DUMP: classParentId: 17
334 DUMP: lexicalParentId: 0
335 DUMP: name: I64C
336 DUMP: typeId: 18
337 DUMP: dataKind: const
338 DUMP: locationType: constant
339 DUMP: constType: 0
340 DUMP: unalignedType: 0
341 DUMP: volatileType: 0
342 DUMP: value: 9223372036854775807
343 DUMP: }
344 DUMP: }
345 DUMP: {
346 DUMP: symIndexId: 22
347 DUMP: symTag: 12
348 DUMP: baseType: 2
349 DUMP: lexicalParentId: 0
350 DUMP: name: U8
351 DUMP: typeId: 23
352 DUMP: length: 1
353 DUMP: constructor: 0
354 DUMP: constType: 0
355 DUMP: hasAssignmentOperator: 0
356 DUMP: hasCastOperator: 0
357 DUMP: hasNestedTypes: 0
358 DUMP: overloadedOperator: 0
359 DUMP: isInterfaceUdt: 0
360 DUMP: intrinsic: 0
361 DUMP: nested: 0
362 DUMP: packed: 0
363 DUMP: isRefUdt: 0
364 DUMP: scoped: 0
365 DUMP: unalignedType: 0
366 DUMP: isValueUdt: 0
367 DUMP: volatileType: 0
368 DUMP: {
369 DUMP: symIndexId: 24
370 DUMP: symTag: 7
371 DUMP: classParentId: 22
372 DUMP: lexicalParentId: 0
373 DUMP: name: U8A
374 DUMP: typeId: 23
375 DUMP: dataKind: const
376 DUMP: locationType: constant
377 DUMP: constType: 0
378 DUMP: unalignedType: 0
379 DUMP: volatileType: 0
380 DUMP: value: 0
381 DUMP: }
382 DUMP: {
383 DUMP: symIndexId: 25
384 DUMP: symTag: 7
385 DUMP: classParentId: 22
386 DUMP: lexicalParentId: 0
387 DUMP: name: U8B
388 DUMP: typeId: 23
389 DUMP: dataKind: const
390 DUMP: locationType: constant
391 DUMP: constType: 0
392 DUMP: unalignedType: 0
393 DUMP: volatileType: 0
394 DUMP: value: 255
395 DUMP: }
396 DUMP: }
397 DUMP: {
398 DUMP: symIndexId: 26
399 DUMP: symTag: 12
400 DUMP: baseType: 7
401 DUMP: lexicalParentId: 0
402 DUMP: name: U16
403 DUMP: typeId: 27
404 DUMP: length: 2
405 DUMP: constructor: 0
406 DUMP: constType: 0
407 DUMP: hasAssignmentOperator: 0
408 DUMP: hasCastOperator: 0
409 DUMP: hasNestedTypes: 0
410 DUMP: overloadedOperator: 0
411 DUMP: isInterfaceUdt: 0
412 DUMP: intrinsic: 0
413 DUMP: nested: 0
414 DUMP: packed: 0
415 DUMP: isRefUdt: 0
416 DUMP: scoped: 0
417 DUMP: unalignedType: 0
418 DUMP: isValueUdt: 0
419 DUMP: volatileType: 0
420 DUMP: {
421 DUMP: symIndexId: 28
422 DUMP: symTag: 7
423 DUMP: classParentId: 26
424 DUMP: lexicalParentId: 0
425 DUMP: name: U16A
426 DUMP: typeId: 27
427 DUMP: dataKind: const
428 DUMP: locationType: constant
429 DUMP: constType: 0
430 DUMP: unalignedType: 0
431 DUMP: volatileType: 0
432 DUMP: value: 0
433 DUMP: }
434 DUMP: {
435 DUMP: symIndexId: 29
436 DUMP: symTag: 7
437 DUMP: classParentId: 26
438 DUMP: lexicalParentId: 0
439 DUMP: name: U16B
440 DUMP: typeId: 27
441 DUMP: dataKind: const
442 DUMP: locationType: constant
443 DUMP: constType: 0
444 DUMP: unalignedType: 0
445 DUMP: volatileType: 0
446 DUMP: value: 65535
447 DUMP: }
448 DUMP: }
449 DUMP: {
450 DUMP: symIndexId: 30
451 DUMP: symTag: 12
452 DUMP: baseType: 7
453 DUMP: lexicalParentId: 0
454 DUMP: name: U32
455 DUMP: typeId: 31
456 DUMP: length: 4
457 DUMP: constructor: 0
458 DUMP: constType: 0
459 DUMP: hasAssignmentOperator: 0
460 DUMP: hasCastOperator: 0
461 DUMP: hasNestedTypes: 0
462 DUMP: overloadedOperator: 0
463 DUMP: isInterfaceUdt: 0
464 DUMP: intrinsic: 0
465 DUMP: nested: 0
466 DUMP: packed: 0
467 DUMP: isRefUdt: 0
468 DUMP: scoped: 0
469 DUMP: unalignedType: 0
470 DUMP: isValueUdt: 0
471 DUMP: volatileType: 0
472 DUMP: {
473 DUMP: symIndexId: 32
474 DUMP: symTag: 7
475 DUMP: classParentId: 30
476 DUMP: lexicalParentId: 0
477 DUMP: name: U32A
478 DUMP: typeId: 31
479 DUMP: dataKind: const
480 DUMP: locationType: constant
481 DUMP: constType: 0
482 DUMP: unalignedType: 0
483 DUMP: volatileType: 0
484 DUMP: value: 0
485 DUMP: }
486 DUMP: {
487 DUMP: symIndexId: 33
488 DUMP: symTag: 7
489 DUMP: classParentId: 30
490 DUMP: lexicalParentId: 0
491 DUMP: name: U32B
492 DUMP: typeId: 31
493 DUMP: dataKind: const
494 DUMP: locationType: constant
495 DUMP: constType: 0
496 DUMP: unalignedType: 0
497 DUMP: volatileType: 0
498 DUMP: value: 4294967295
499 DUMP: }
500 DUMP: }
501 DUMP: {
502 DUMP: symIndexId: 34
503 DUMP: symTag: 12
504 DUMP: baseType: 7
505 DUMP: lexicalParentId: 0
506 DUMP: name: U64
507 DUMP: typeId: 35
508 DUMP: length: 8
509 DUMP: constructor: 0
510 DUMP: constType: 0
511 DUMP: hasAssignmentOperator: 0
512 DUMP: hasCastOperator: 0
513 DUMP: hasNestedTypes: 0
514 DUMP: overloadedOperator: 0
515 DUMP: isInterfaceUdt: 0
516 DUMP: intrinsic: 0
517 DUMP: nested: 0
518 DUMP: packed: 0
519 DUMP: isRefUdt: 0
520 DUMP: scoped: 0
521 DUMP: unalignedType: 0
522 DUMP: isValueUdt: 0
523 DUMP: volatileType: 0
524 DUMP: {
525 DUMP: symIndexId: 36
526 DUMP: symTag: 7
527 DUMP: classParentId: 34
528 DUMP: lexicalParentId: 0
529 DUMP: name: U64A
530 DUMP: typeId: 35
531 DUMP: dataKind: const
532 DUMP: locationType: constant
533 DUMP: constType: 0
534 DUMP: unalignedType: 0
535 DUMP: volatileType: 0
536 DUMP: value: 0
537 DUMP: }
538 DUMP: {
539 DUMP: symIndexId: 37
540 DUMP: symTag: 7
541 DUMP: classParentId: 34
542 DUMP: lexicalParentId: 0
543 DUMP: name: U64B
544 DUMP: typeId: 35
545 DUMP: dataKind: const
546 DUMP: locationType: constant
547 DUMP: constType: 0
548 DUMP: unalignedType: 0
549 DUMP: volatileType: 0
550 DUMP: value: 255
551 DUMP: }
552 DUMP: }
553 DUMP: {
554 DUMP: symIndexId: 38
555 DUMP: symTag: 12
556 DUMP: baseType: 7
557 DUMP: lexicalParentId: 0
558 DUMP: name: Char16
559 DUMP: typeId: 27
560 DUMP: length: 2
561 DUMP: constructor: 0
562 DUMP: constType: 0
563 DUMP: hasAssignmentOperator: 0
564 DUMP: hasCastOperator: 0
565 DUMP: hasNestedTypes: 0
566 DUMP: overloadedOperator: 0
567 DUMP: isInterfaceUdt: 0
568 DUMP: intrinsic: 0
569 DUMP: nested: 0
570 DUMP: packed: 0
571 DUMP: isRefUdt: 0
572 DUMP: scoped: 0
573 DUMP: unalignedType: 0
574 DUMP: isValueUdt: 0
575 DUMP: volatileType: 0
576 DUMP: {
577 DUMP: symIndexId: 39
578 DUMP: symTag: 7
579 DUMP: classParentId: 38
580 DUMP: lexicalParentId: 0
581 DUMP: name: C16A
582 DUMP: typeId: 27
583 DUMP: dataKind: const
584 DUMP: locationType: constant
585 DUMP: constType: 0
586 DUMP: unalignedType: 0
587 DUMP: volatileType: 0
588 DUMP: value: 97
589 DUMP: }
590 DUMP: {
591 DUMP: symIndexId: 40
592 DUMP: symTag: 7
593 DUMP: classParentId: 38
594 DUMP: lexicalParentId: 0
595 DUMP: name: C16B
596 DUMP: typeId: 27
597 DUMP: dataKind: const
598 DUMP: locationType: constant
599 DUMP: constType: 0
600 DUMP: unalignedType: 0
601 DUMP: volatileType: 0
602 DUMP: value: 98
603 DUMP: }
604 DUMP: }
605 DUMP: {
606 DUMP: symIndexId: 41
607 DUMP: symTag: 12
608 DUMP: baseType: 7
609 DUMP: lexicalParentId: 0
610 DUMP: name: Char32
611 DUMP: typeId: 42
612 DUMP: length: 4
613 DUMP: constructor: 0
614 DUMP: constType: 0
615 DUMP: hasAssignmentOperator: 0
616 DUMP: hasCastOperator: 0
617 DUMP: hasNestedTypes: 0
618 DUMP: overloadedOperator: 0
619 DUMP: isInterfaceUdt: 0
620 DUMP: intrinsic: 0
621 DUMP: nested: 0
622 DUMP: packed: 0
623 DUMP: isRefUdt: 0
624 DUMP: scoped: 0
625 DUMP: unalignedType: 0
626 DUMP: isValueUdt: 0
627 DUMP: volatileType: 0
628 DUMP: {
629 DUMP: symIndexId: 43
630 DUMP: symTag: 7
631 DUMP: classParentId: 41
632 DUMP: lexicalParentId: 0
633 DUMP: name: C32A
634 DUMP: typeId: 42
635 DUMP: dataKind: const
636 DUMP: locationType: constant
637 DUMP: constType: 0
638 DUMP: unalignedType: 0
639 DUMP: volatileType: 0
640 DUMP: value: 97
641 DUMP: }
642 DUMP: {
643 DUMP: symIndexId: 44
644 DUMP: symTag: 7
645 DUMP: classParentId: 41
646 DUMP: lexicalParentId: 0
647 DUMP: name: C32B
648 DUMP: typeId: 42
649 DUMP: dataKind: const
650 DUMP: locationType: constant
651 DUMP: constType: 0
652 DUMP: unalignedType: 0
653 DUMP: volatileType: 0
654 DUMP: value: 98
655 DUMP: }
656 DUMP: }
657 DUMP: {
658 DUMP: symIndexId: 45
659 DUMP: symTag: 12
660 DUMP: baseType: 7
661 DUMP: lexicalParentId: 0
662 DUMP: name: WChar
663 DUMP: typeId: 27
664 DUMP: length: 2
665 DUMP: constructor: 0
666 DUMP: constType: 0
667 DUMP: hasAssignmentOperator: 0
668 DUMP: hasCastOperator: 0
669 DUMP: hasNestedTypes: 0
670 DUMP: overloadedOperator: 0
671 DUMP: isInterfaceUdt: 0
672 DUMP: intrinsic: 0
673 DUMP: nested: 0
674 DUMP: packed: 0
675 DUMP: isRefUdt: 0
676 DUMP: scoped: 0
677 DUMP: unalignedType: 0
678 DUMP: isValueUdt: 0
679 DUMP: volatileType: 0
680 DUMP: {
681 DUMP: symIndexId: 46
682 DUMP: symTag: 7
683 DUMP: classParentId: 45
684 DUMP: lexicalParentId: 0
685 DUMP: name: WCA
686 DUMP: typeId: 27
687 DUMP: dataKind: const
688 DUMP: locationType: constant
689 DUMP: constType: 0
690 DUMP: unalignedType: 0
691 DUMP: volatileType: 0
692 DUMP: value: 97
693 DUMP: }
694 DUMP: {
695 DUMP: symIndexId: 47
696 DUMP: symTag: 7
697 DUMP: classParentId: 45
698 DUMP: lexicalParentId: 0
699 DUMP: name: WCB
700 DUMP: typeId: 27
701 DUMP: dataKind: const
702 DUMP: locationType: constant
703 DUMP: constType: 0
704 DUMP: unalignedType: 0
705 DUMP: volatileType: 0
706 DUMP: value: 98
707 DUMP: }
708 DUMP: }
709 DUMP: {
710 DUMP: symIndexId: 48
711 DUMP: symTag: 12
712 DUMP: baseType: 10
713 DUMP: lexicalParentId: 0
714 DUMP: name: Bool
715 DUMP: typeId: 49
716 DUMP: length: 1
717 DUMP: constructor: 0
718 DUMP: constType: 0
719 DUMP: hasAssignmentOperator: 0
720 DUMP: hasCastOperator: 0
721 DUMP: hasNestedTypes: 0
722 DUMP: overloadedOperator: 0
723 DUMP: isInterfaceUdt: 0
724 DUMP: intrinsic: 0
725 DUMP: nested: 0
726 DUMP: packed: 0
727 DUMP: isRefUdt: 0
728 DUMP: scoped: 0
729 DUMP: unalignedType: 0
730 DUMP: isValueUdt: 0
731 DUMP: volatileType: 0
732 DUMP: {
733 DUMP: symIndexId: 50
734 DUMP: symTag: 7
735 DUMP: classParentId: 48
736 DUMP: lexicalParentId: 0
737 DUMP: name: BA
738 DUMP: typeId: 49
739 DUMP: dataKind: const
740 DUMP: locationType: constant
741 DUMP: constType: 0
742 DUMP: unalignedType: 0
743 DUMP: volatileType: 0
744 DUMP: value: true
745 DUMP: }
746 DUMP: {
747 DUMP: symIndexId: 51
748 DUMP: symTag: 7
749 DUMP: classParentId: 48
750 DUMP: lexicalParentId: 0
751 DUMP: name: BB
752 DUMP: typeId: 49
753 DUMP: dataKind: const
754 DUMP: locationType: constant
755 DUMP: constType: 0
756 DUMP: unalignedType: 0
757 DUMP: volatileType: 0
758 DUMP: value: false
759 DUMP: }
760 DUMP: {
761 DUMP: symIndexId: 113
762 DUMP: symTag: 12
763 DUMP: baseType: 6
764 DUMP: lexicalParentId: 0
765 DUMP: name: EC
766 DUMP: typeId: 13
767 DUMP: length: 4
768 DUMP: constructor: 0
769 DUMP: constType: 0
770 DUMP: hasAssignmentOperator: 0
771 DUMP: hasCastOperator: 0
772 DUMP: hasNestedTypes: 0
773 DUMP: overloadedOperator: 0
774 DUMP: isInterfaceUdt: 0
775 DUMP: intrinsic: 0
776 DUMP: nested: 0
777 DUMP: packed: 0
778 DUMP: isRefUdt: 0
779 DUMP: scoped: 0
780 DUMP: unalignedType: 0
781 DUMP: isValueUdt: 0
782 DUMP: volatileType: 0
783 DUMP: {
784 DUMP: symIndexId: 114
785 DUMP: symTag: 7
786 DUMP: classParentId: 113
787 DUMP: lexicalParentId: 0
788 DUMP: name: A
789 DUMP: typeId: 13
790 DUMP: dataKind: const
791 DUMP: locationType: constant
792 DUMP: constType: 0
793 DUMP: unalignedType: 0
794 DUMP: volatileType: 0
795 DUMP: value: 1
796 DUMP: }
797 DUMP: {
798 DUMP: symIndexId: 115
799 DUMP: symTag: 7
800 DUMP: classParentId: 113
801 DUMP: lexicalParentId: 0
802 DUMP: name: B
803 DUMP: typeId: 13
804 DUMP: dataKind: const
805 DUMP: locationType: constant
806 DUMP: constType: 0
807 DUMP: unalignedType: 0
808 DUMP: volatileType: 0
809 DUMP: value: 2
810 DUMP: }
811 DUMP: }
812 DUMP: {
813 DUMP: symIndexId: 116
814 DUMP: symTag: 12
815 DUMP: baseType: 6
816 DUMP: lexicalParentId: 0
817 DUMP: name: Struct::Nested
818 DUMP: typeId: 13
819 DUMP: length: 4
820 DUMP: constructor: 0
821 DUMP: constType: 0
822 DUMP: hasAssignmentOperator: 0
823 DUMP: hasCastOperator: 0
824 DUMP: hasNestedTypes: 0
825 DUMP: overloadedOperator: 0
826 DUMP: isInterfaceUdt: 0
827 DUMP: intrinsic: 0
828 DUMP: nested: 1
829 DUMP: packed: 0
830 DUMP: isRefUdt: 0
831 DUMP: scoped: 0
832 DUMP: unalignedType: 0
833 DUMP: isValueUdt: 0
834 DUMP: volatileType: 0
835 DUMP: {
836 DUMP: symIndexId: 114
837 DUMP: symTag: 7
838 DUMP: classParentId: 113
839 DUMP: lexicalParentId: 0
840 DUMP: name: A
841 DUMP: typeId: 13
842 DUMP: dataKind: const
843 DUMP: locationType: constant
844 DUMP: constType: 0
845 DUMP: unalignedType: 0
846 DUMP: volatileType: 0
847 DUMP: value: 1
848 DUMP: }
849 DUMP: {
850 DUMP: symIndexId: 115
851 DUMP: symTag: 7
852 DUMP: classParentId: 113
853 DUMP: lexicalParentId: 0
854 DUMP: name: B
855 DUMP: typeId: 13
856 DUMP: dataKind: const
857 DUMP: locationType: constant
858 DUMP: constType: 0
859 DUMP: unalignedType: 0
860 DUMP: volatileType: 0
861 DUMP: value: 2
862 DUMP: }
863 DUMP: }
864 DUMP: {
865 DUMP: symIndexId: 117
866 DUMP: symTag: 12
867 DUMP: baseType: 6
868 DUMP: lexicalParentId: 0
869 DUMP: name: EC
870 DUMP: typeId: 13
871 DUMP: unmodifiedTypeId: 113
872 DUMP: length: 4
873 DUMP: constructor: 0
874 DUMP: constType: 1
875 DUMP: hasAssignmentOperator: 0
876 DUMP: hasCastOperator: 0
877 DUMP: hasNestedTypes: 0
878 DUMP: overloadedOperator: 0
879 DUMP: isInterfaceUdt: 0
880 DUMP: intrinsic: 0
881 DUMP: nested: 0
882 DUMP: packed: 0
883 DUMP: isRefUdt: 0
884 DUMP: scoped: 0
885 DUMP: unalignedType: 0
886 DUMP: isValueUdt: 0
887 DUMP: volatileType: 1 {
888 DUMP: symIndexId: 114
889 DUMP: symTag: 7
890 DUMP: classParentId: 113
891 DUMP: lexicalParentId: 0
892 DUMP: name: A
893 DUMP: typeId: 13
894 DUMP: dataKind: const
895 DUMP: locationType: constant
896 DUMP: constType: 0
897 DUMP: unalignedType: 0
898 DUMP: volatileType: 0
899 DUMP: value: 1
900 DUMP: }
901 DUMP: {
902 DUMP: symIndexId: 115
903 DUMP: symTag: 7
904 DUMP: classParentId: 113
905 DUMP: lexicalParentId: 0
906 DUMP: name: B
907 DUMP: typeId: 13
908 DUMP: dataKind: const
909 DUMP: locationType: constant
910 DUMP: constType: 0
911 DUMP: unalignedType: 0
912 DUMP: volatileType: 0
913 DUMP: value: 2
914 DUMP: }
915 DUMP: }
969969 while (auto Child = Children->getNext()) {
970970 outs() << "{";
971971 Child->defaultDump(outs(), 2);
972 if (auto Enum = dyn_cast(Child.get())) {
973 auto Enumerators = Enum->findAllChildren();
974 while (auto Enumerator = Enumerators->getNext()) {
975 outs() << " {";
976 Enumerator->defaultDump(outs(), 4);
977 outs() << "\n }\n";
978 }
979 }
972980 outs() << "\n}\n";
973981 }
974982 }