[reland][Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Tue, 28 Jun 2022 16:52:12 +0000 (19:52 +0300)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 1 Jul 2022 17:08:09 +0000 (20:08 +0300)
commit554aea52d79ebd9353911ecf2ffe14aca132f452
tree15783be4d9bad1494cc607faa6546d1a98f28629
parentb5e49cdea971742d2fbc8ae35878fcc21daebba1
[reland][Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef.

This review is extracted from D96035.

This patch adds possibility to keep not only DwarfStringPoolEntry, but also
pointer to it. The DwarfStringPoolEntryRef keeps reference to the string map entry.
String map keeps string data and corresponding DwarfStringPoolEntry
info. Not all string map entries may be included into the result,
and then not all string entries should have DwarfStringPoolEntry
info. Currently StringMap keeps DwarfStringPoolEntry for all entries.
It leads to extra memory usage. This patch allows to keep
DwarfStringPoolEntry info only for entries which really need it.

[reland] : make msan happy.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D126883
llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
llvm/unittests/CodeGen/CMakeLists.txt
llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp [new file with mode: 0644]