From 91db8008a96b73407213cbc6bb81981472bbdae5 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 24 Oct 2017 17:02:40 +0000 Subject: [PATCH] [codeview] Fix handling of S_HEAPALLOCSITE The type index is from the TPI stream, not the IPI stream. Fix the dumper, fix type index discovery, and add a test in LLD. Also improve the log message we emit when we fail to rewrite type indices in LLD. That's how I found this bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316461 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp | 3 +-- tools/llvm-pdbutil/MinimalSymbolDumper.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp b/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp index 104e8f78589..c23fadc2304 100644 --- a/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp +++ b/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp @@ -413,8 +413,7 @@ static bool discoverTypeIndices(ArrayRef Content, SymbolKind Kind, Refs.push_back({TiRefKind::IndexRef, 8, 1}); // ID of inlinee break; case SymbolKind::S_HEAPALLOCSITE: - // FIXME: It's not clear if this is a type or item reference. - Refs.push_back({TiRefKind::IndexRef, 8, 1}); // signature + Refs.push_back({TiRefKind::TypeRef, 8, 1}); // UDT allocated break; // Defranges don't have types, just registers and code offsets. diff --git a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp index 263b3fa3718..48c71652d9e 100644 --- a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp +++ b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp @@ -615,7 +615,7 @@ Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, FrameProcSym &FP) { Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, HeapAllocationSiteSym &HAS) { AutoIndent Indent(P, 7); - P.formatLine("type = {0}, addr = {1} call size = {2}", idIndex(HAS.Type), + P.formatLine("type = {0}, addr = {1} call size = {2}", typeIndex(HAS.Type), formatSegmentOffset(HAS.Segment, HAS.CodeOffset), HAS.CallInstructionSize); return Error::success(); -- 2.50.1