[lld] r357658 - [codeview] Remove Type member from CVRecord

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 17:28:48 PDT 2019


Author: rnk
Date: Wed Apr  3 17:28:48 2019
New Revision: 357658

URL: http://llvm.org/viewvc/llvm-project?rev=357658&view=rev
Log:
[codeview] Remove Type member from CVRecord

Summary:
Now CVType and CVSymbol are effectively type-safe wrappers around
ArrayRef<uint8_t>. Make the kind() accessor load it from the
RecordPrefix, which is the same for types and symbols.

Reviewers: zturner, aganea

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60018

Modified:
    lld/trunk/COFF/PDB.cpp

Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=357658&r1=357657&r2=357658&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Wed Apr  3 17:28:48 2019
@@ -759,7 +759,7 @@ static void translateIdSymbols(MutableAr
   if (Kind == SymbolKind::S_GPROC32_ID || Kind == SymbolKind::S_LPROC32_ID) {
     SmallVector<TiReference, 1> Refs;
     auto Content = RecordData.drop_front(sizeof(RecordPrefix));
-    CVSymbol Sym(Kind, RecordData);
+    CVSymbol Sym(RecordData);
     discoverTypeIndicesInSymbol(Sym, Refs);
     assert(Refs.size() == 1);
     assert(Refs.front().Count == 1);
@@ -959,7 +959,7 @@ void PDBLinker::mergeSymbolRecords(ObjFi
         MutableArrayRef<uint8_t> RecordBytes;
         if (NeedsRealignment) {
           RecordBytes = copyAndAlignSymbol(Sym, AlignedSymbolMem);
-          Sym = CVSymbol(Sym.kind(), RecordBytes);
+          Sym = CVSymbol(RecordBytes);
         } else {
           // Otherwise, we can actually mutate the symbol directly, since we
           // copied it to apply relocations.
@@ -983,7 +983,7 @@ void PDBLinker::mergeSymbolRecords(ObjFi
         // An object file may have S_xxx_ID symbols, but these get converted to
         // "real" symbols in a PDB.
         translateIdSymbols(RecordBytes, TMerger.getIDTable());
-        Sym = CVSymbol(symbolKind(RecordBytes), RecordBytes);
+        Sym = CVSymbol(RecordBytes);
 
         // If this record refers to an offset in the object file's string table,
         // add that item to the global PDB string table and re-write the index.




More information about the llvm-commits mailing list