Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 17 Feb 2020 15:31:25 +0000 (16:31 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 17 Feb 2020 15:35:42 +0000 (16:35 +0100)
commit21780888791837b575d227a9a69c1afee9e4c29d
tree7ff79658fe865322fcc57f08b9e301b40ddb1e77
parentf128f442a3d23674bee19ae18e29f92c9dfe40cd
Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map

As discussed in https://reviews.llvm.org/D73206#1871895 there is both
`DIERef` and `user_id_t` and sometimes (for DWZ) we need to encode Main
CU into them and sometimes we cannot as it is unavailable at that point
and at the same time not even needed.

I have also noticed `DIERef` and `user_id_t` in fact contain the same
information which can be seen in SymbolFileDWARF::GetUID.

SB* API/ABI is already using `user_id_t` and it needs to encode Main CU
for DWZ. Therefore what about making `DIERef` the identifier not
containing Main CU and `user_id_t` the identifier containing Main CU?

It is sort of a revert of D63322.

I find this patch as a NFC cleanup to the codebase - to satisfy a new
premise `user_id_t` is used as little as possible and thus only for
external interfaces which must not deal with MainCU in any way.

Its larger goal is to satisfy a plan to implement DWZ support.

Differential Revision: https://reviews.llvm.org/D74637
lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h