[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.
llvm-svn: 347018
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
index 54c40a0..c965870 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
@@ -36,12 +36,12 @@
/// parts of the PDB into a single place, simplifying acess to compile unit
/// information for the callers.
struct CompilandIndexItem {
- CompilandIndexItem(PdbSymUid uid,
+ CompilandIndexItem(PdbCompilandId m_id,
llvm::pdb::ModuleDebugStreamRef debug_stream,
llvm::pdb::DbiModuleDescriptor descriptor);
- // uid of this compile unit.
- PdbSymUid m_uid;
+ // index of this compile unit.
+ PdbCompilandId m_id;
// debug stream.
llvm::pdb::ModuleDebugStreamRef m_debug_stream;
@@ -76,20 +76,16 @@
/// global compile unit index to |CompilandIndexItem| structures.
class CompileUnitIndex {
PdbIndex &m_index;
- llvm::DenseMap<lldb::user_id_t, std::unique_ptr<CompilandIndexItem>>
- m_comp_units;
+ llvm::DenseMap<uint16_t, std::unique_ptr<CompilandIndexItem>> m_comp_units;
public:
explicit CompileUnitIndex(PdbIndex &index) : m_index(index) {}
CompilandIndexItem &GetOrCreateCompiland(uint16_t modi);
- CompilandIndexItem &GetOrCreateCompiland(PdbSymUid compiland_uid);
const CompilandIndexItem *GetCompiland(uint16_t modi) const;
- const CompilandIndexItem *GetCompiland(PdbSymUid compiland_uid) const;
CompilandIndexItem *GetCompiland(uint16_t modi);
- CompilandIndexItem *GetCompiland(PdbSymUid compiland_uid);
llvm::SmallString<64> GetMainSourceFile(const CompilandIndexItem &item) const;
};