[PATCH] D19445: Refactor some more PDB reading code into DebugInfoPDB

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 18:54:23 PDT 2016


majnemer added inline comments.

================
Comment at: include/llvm/DebugInfo/PDB/Raw/PDBInfoStream.h:40-51
@@ +39,14 @@
+
+  // PDB file format version.  We only support VC70.  See the enumeration
+  // `PdbRaw_ImplVer` for the other possible values.
+  support::ulittle32_t Version;
+
+  // A 32-bit signature unique across all PDBs.  This is generated with
+  // a call to time() when the PDB is written, but obviously this is not
+  // universally unique.
+  support::ulittle32_t Signature;
+
+  // The number of times the PDB has been written.  Might also be used to
+  // ensure that the PDB matches the executable.
+  support::ulittle32_t Age;
+
----------------
It's a little unusual to have these be members be `support::ulittle32_t`.  Instead, can you have them be `uint32_t` and initialize them via `readInteger`?

================
Comment at: include/llvm/DebugInfo/PDB/Raw/PDBNameMap.h:27
@@ +26,3 @@
+
+  bool TryGetValue(StringRef Name, uint32_t &Value) const;
+
----------------
`tryGetValue`

================
Comment at: lib/DebugInfo/PDB/Raw/PDBInfoStream.cpp:42
@@ +41,3 @@
+PdbRaw_ImplVer PDBInfoStream::getVersion() const {
+  uint32_t Value = static_cast<uint32_t>(Version);
+  return static_cast<PdbRaw_ImplVer>(Value);
----------------
This cast can be removed if you make `Version` a `uint32_t`.


http://reviews.llvm.org/D19445





More information about the llvm-commits mailing list