; RUN: | FileCheck --check-prefix=NODEPS %s
; RUN: llvm-pdbutil dump -type-index=0x1019 -dependents -dont-resolve-forward-refs \
; RUN: %p/Inputs/ClassLayoutTest.pdb | FileCheck --check-prefix=DEPS %s
+; RUN: llvm-pdbutil dump -type-index=0x3,0x30,0x44,0x74 \
+; RUN: %p/Inputs/ClassLayoutTest.pdb | FileCheck --check-prefix=SIMPLE %s
NODEPS: Types (TPI Stream)
DEPS-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100E
DEPS-NEXT: class type = 0x1017, this type = 0x1018, this adjust = 0
DEPS-NEXT: calling conv = thiscall, options = None
+
+
+SIMPLE: Types (TPI Stream)
+SIMPLE-NEXT: ============================================================
+SIMPLE-NEXT: Showing 4 records.
+SIMPLE-NEXT: 0x0003 (void) | void
+SIMPLE-NEXT: 0x0030 (bool) | bool
+SIMPLE-NEXT: 0x0044 (__float48) | __float48
+SIMPLE-NEXT: 0x0074 (int) | int
for (const auto &I : TiList) {
TypeIndex TI(I);
- CVType Type = Types.getType(TI);
- if (auto EC = codeview::visitTypeRecord(Type, TI, V))
- Printer.formatLine("An error occurred dumping type record {0}: {1}", TI,
- toString(std::move(EC)));
+ if (TI.isSimple()) {
+ Printer.formatLine("{0} | {1}", fmt_align(I, AlignStyle::Right, Width),
+ Types.getTypeName(TI));
+ } else if (Optional<CVType> Type = Types.tryGetType(TI)) {
+ if (auto EC = codeview::visitTypeRecord(*Type, TI, V))
+ Printer.formatLine("An error occurred dumping type record {0}: {1}",
+ TI, toString(std::move(EC)));
+ } else {
+ Printer.formatLine("Type {0} doesn't exist in TPI stream", TI);
+ }
}
}
}