[llvm] r347018 - [NativePDB] Rewrite the PdbSymUid to use our own custom namespacing scheme.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 15 18:42:32 PST 2018


Author: zturner
Date: Thu Nov 15 18:42:32 2018
New Revision: 347018

URL: http://llvm.org/viewvc/llvm-project?rev=347018&view=rev
Log:
[NativePDB] Rewrite the PdbSymUid to use our own custom namespacing scheme.

Originally we created our 64-bit UID scheme by using the first byte as
sort of a "tag" to represent what kind of symbol this was, and we
re-used the PDB_SymType enumeration for this.  For native pdb support,
this is not really the right abstraction layer, because what we really
want is something that tells us *how* to find the symbol.  This means,
specifically, is in the globals stream / public stream / module stream /
TPI stream / etc, and for whichever one it is in, where is it within
that stream?

A good example of why the old namespacing scheme was insufficient is
that it is more or less impossible to create a uid for a field list
member of a class/struction/union/enum that tells you how to locate
the original record.

With this new scheme, the first byte is no longer a PDB_SymType enum
but a new enum created specifically to identify where in the PDB
this record lives.  This gives us much better flexibility in
what kinds of symbols the uids can identify.

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=347018&r1=347017&r2=347018&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Thu Nov 15 18:42:32 2018
@@ -400,6 +400,7 @@ public:
   uint16_t Module;
   StringRef Name;
 
+  uint16_t modi() const { return Module - 1; }
   uint32_t RecordOffset;
 };
 




More information about the llvm-commits mailing list