From c41ce8355f88ce522dabde2b435bfe83d550a379 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 18 Sep 2018 16:35:05 +0000 Subject: [PDB] Better support for enumerating pointer types. There were several issues with the previous implementation. 1) There were no tests. 2) We didn't support creating PDBSymbolTypePointer records for builtin types since those aren't described by LF_POINTER records. 3) We didn't support a wide enough variety of builtin types even ignoring pointers. This patch fixes all of these issues. In order to add tests, it's helpful to be able to ignore the symbol index id hierarchy because it makes the golden output from the DIA version not match our output, so I've extended the dumper to disable dumping of id fields. llvm-svn: 342493 --- .../lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp index 18b13b07607..6ebb8cae3a6 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NativeSymbolEnumerator.cpp @@ -25,12 +25,19 @@ NativeSymbolEnumerator::NativeSymbolEnumerator( NativeSymbolEnumerator::~NativeSymbolEnumerator() {} -void NativeSymbolEnumerator::dump(raw_ostream &OS, int Indent) const { - NativeRawSymbol::dump(OS, Indent); - dumpSymbolField(OS, "classParentId", getClassParentId(), Indent); - dumpSymbolField(OS, "lexicalParentId", getLexicalParentId(), Indent); +void NativeSymbolEnumerator::dump(raw_ostream &OS, int Indent, + PdbSymbolIdField ShowIdFields, + PdbSymbolIdField RecurseIdFields) const { + NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields); + dumpSymbolIdField(OS, "classParentId", getClassParentId(), Indent, Session, + PdbSymbolIdField::ClassParent, ShowIdFields, + RecurseIdFields); + dumpSymbolIdField(OS, "lexicalParentId", getLexicalParentId(), Indent, + Session, PdbSymbolIdField::LexicalParent, ShowIdFields, + RecurseIdFields); dumpSymbolField(OS, "name", getName(), Indent); - dumpSymbolField(OS, "typeId", getTypeId(), Indent); + dumpSymbolIdField(OS, "typeId", getTypeId(), Indent, Session, + PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields); dumpSymbolField(OS, "dataKind", getDataKind(), Indent); dumpSymbolField(OS, "locationType", getLocationType(), Indent); dumpSymbolField(OS, "constType", isConstType(), Indent); -- cgit v1.2.3