[llvm] r307436 - [PDB] More changes to bring lld PDBs to parity with MSVC.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 13:25:39 PDT 2017


Author: zturner
Date: Fri Jul  7 13:25:39 2017
New Revision: 307436

URL: http://llvm.org/viewvc/llvm-project?rev=307436&view=rev
Log:
[PDB] More changes to bring lld PDBs to parity with MSVC.

1) Don't write a /src/headerblock stream.  This appears to be
   written conditionally by MSVC, but it's not clear what the
   condition is.  For now, just remove it since we dont' know
   what it is anyway and the particular pdb we've checked in
   for the test doesn't have one.
2) Write a valid timestamp for the PDB file signature.  This
   leads to non-reproducible builds, but it matches the default
   behavior of link, so it should be out default as well.  If
   we need reproducibility, we should add a separate command
   line option for it that is off by default.
3) Write an empty FPO stream.  MSVC seems to always write an
   FPO stream.  This change makes the stream directory match
   up, although we still need to make the contents of the FPO
   stream match.

Modified:
    llvm/trunk/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
    llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp?rev=307436&r1=307435&r2=307436&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp Fri Jul  7 13:25:39 2017
@@ -86,7 +86,8 @@ Error NamedStreamMap::commit(BinaryStrea
 
   for (const auto &Name : OrderedStreamNames) {
     auto Item = Mapping.find(Name);
-    assert(Item != Mapping.end());
+    if (Item == Mapping.end())
+      continue;
     if (auto EC = Writer.writeCString(Item->getKey()))
       return EC;
   }
@@ -108,7 +109,8 @@ uint32_t NamedStreamMap::finalize() {
 
   for (const auto &Name : OrderedStreamNames) {
     auto Item = Mapping.find(Name);
-    assert(Item != Mapping.end());
+    if (Item == Mapping.end())
+      continue;
     FinalizedHashTable.set(FinalizedInfo->StringDataBytes, Item->getValue());
     FinalizedInfo->StringDataBytes += Item->getKeyLength() + 1;
   }

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp?rev=307436&r1=307435&r2=307436&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp Fri Jul  7 13:25:39 2017
@@ -96,8 +96,6 @@ Expected<msf::MSFLayout> PDBFileBuilder:
     return std::move(EC);
   if (auto EC = addNamedStream("/LinkInfo", 0))
     return std::move(EC);
-  if (auto EC = addNamedStream("/src/headerblock", 0))
-    return std::move(EC);
 
   if (Info) {
     if (auto EC = Info->finalizeMsfLayout())




More information about the llvm-commits mailing list