[PATCH] D66431: [PDB] Fix bug when using multiple PCH header objects with the same name.

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 10:53:05 PDT 2019


aganea added a comment.

In D66431#1642619 <https://reviews.llvm.org/D66431#1642619>, @thakis wrote:

> Is this only for cl.exe-created pch files? Those create special obj files iirc. Or does it affect clang-cl-built pch obj files as well? (If it's cl.exe-only, please mention that in the patch description.)


Yes, this code is only for MSVC PCH.OBJ files. Clang does not generate `LF_PRECOMP` records.

FYI both the PCH.OBJ and referring OBJs are "special": OBJs contain only a partial `.debug$T` type stream, which cannot be parsed as-is because it is incomplete (the records backreference to other external records in the PCH.OBJ). The PCH.OBJ contains a `.debug$P` type stream, which is back-referred by the OBJ type stream. At runtime, we simply collate the `.debug$P` and the `.debug$T` for each OBJ, which yields a valid type stream ready to be merged into the PDB.



================
Comment at: lld/COFF/PDB.cpp:511
+    SmallString<128> path1_norm = sys::path::convert_to_slash(path1);
+    SmallString<128> path2_norm = sys::path::convert_to_slash(path2);
 #if defined(_WIN32)
----------------
zturner wrote:
> aganea wrote:
> > These two lines do not compile on my PC. I had to change to: `SmallString<128> path1_norm{StringRef(sys::path::convert_to_slash(path1))};`
> Actually I'll just make them std::string instead of SmallString.  That's what convert_to_slash returns anyway.
Also, indentation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66431/new/

https://reviews.llvm.org/D66431





More information about the llvm-commits mailing list