[PATCH] D52283: [PDB] Add the ability to resolve forward references

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 19 15:08:57 PDT 2018


zturner created this revision.
zturner added a reviewer: rnk.
Herald added subscribers: JDevlieghere, hiraditya, aprantl.

Some records point to an `LF_CLASS`, `LF_UNION`, `LF_STRUCTURE`, or `LF_ENUM` which is a forward reference and doesn't contain complete debug information.  In these cases, we'd like to be able to quickly locate the full record.  The TPI stream stores an array of pre-computed record hash values, one for each type record.   If we pre-process this on startup, we can build a mapping from hash value -> {list of possible matching type indices}.  Since hashes of full records are only based on the name and or unique name and not the full record contents, we can then use forward ref record to compute the hash of what *would* be the full record by just hashing the name, use this to get the list of possible matches, and iterate those looking for a match on name or unique name.

llvm-pdbutil is updated to resolve forward references for the purposes of testing (plus it's just useful).


https://reviews.llvm.org/D52283

Files:
  llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
  llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
  llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
  llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
  llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
  llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
  llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp
  llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
  llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
  llvm/lib/DebugInfo/PDB/PDBExtras.cpp
  llvm/test/DebugInfo/PDB/Inputs/every-class.cpp
  llvm/test/DebugInfo/PDB/Inputs/every-class.exe
  llvm/test/DebugInfo/PDB/Inputs/every-class.obj
  llvm/test/DebugInfo/PDB/Inputs/every-class.pdb
  llvm/test/DebugInfo/PDB/every-type.test
  llvm/test/DebugInfo/PDB/pdb-resolve-forward-refs.test
  llvm/test/DebugInfo/PDB/pdbdump-headers.test
  llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
  llvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp
  llvm/tools/llvm-pdbutil/MinimalTypeDumper.h
  llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
  llvm/tools/llvm-pdbutil/llvm-pdbutil.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52283.166189.patch
Type: text/x-patch
Size: 35834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180919/7429b9e7/attachment-0001.bin>


More information about the llvm-commits mailing list