HomePhabricator

Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map

Authored by jankratochvil on Feb 17 2020, 7:31 AM.

Description

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