[lld] 810c8e9 - Revert "[PDB] Avoid calling discoverTypeIndices for a known record kind"

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Sat May 2 18:06:22 PDT 2020


Author: Nico Weber
Date: 2020-05-02T21:06:06-04:00
New Revision: 810c8e9b495c191f49b162cee3fb8829185a2691

URL: https://github.com/llvm/llvm-project/commit/810c8e9b495c191f49b162cee3fb8829185a2691
DIFF: https://github.com/llvm/llvm-project/commit/810c8e9b495c191f49b162cee3fb8829185a2691.diff

LOG: Revert "[PDB] Avoid calling discoverTypeIndices for a known record kind"

This reverts commit bd7ea8641e7667b109534ae06b33be7bc9b59821.
Breaks check-lld everywhere.

Added: 
    

Modified: 
    lld/COFF/PDB.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 6ba6f0b5068a..a182ed34165d 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -726,9 +726,10 @@ static void translateIdSymbols(MutableArrayRef<uint8_t> &recordData,
     // in both cases we just need the second type index.
     if (!ti->isSimple() && !ti->isNoneType()) {
       CVType funcIdData = iDTable.getType(*ti);
-      ArrayRef<uint8_t> tiBuf = funcIdData.data().slice(8, 12);
-      assert(tiBuf.size() == 4 && "corruct LF_[MEM]FUNC_ID record");
-      *ti = *reinterpret_cast<const TypeIndex *>(tiBuf.data());
+      SmallVector<TypeIndex, 2> indices;
+      discoverTypeIndices(funcIdData, indices);
+      assert(indices.size() == 2);
+      *ti = indices[1];
     }
 
     kind = (kind == SymbolKind::S_GPROC32_ID) ? SymbolKind::S_GPROC32


        


More information about the llvm-commits mailing list