File tree Expand file tree Collapse file tree 4 files changed +11
-29
lines changed Expand file tree Collapse file tree 4 files changed +11
-29
lines changed Original file line number Diff line number Diff line change 15
15
#include " llvm/CodeGen/NonRelocatableStringpool.h"
16
16
#include " llvm/DWARFLinker/Classic/DWARFLinkerCompileUnit.h"
17
17
#include " llvm/DWARFLinker/DWARFLinkerBase.h"
18
+ #include " llvm/DWARFLinker/IndexedValuesMap.h"
18
19
#include " llvm/DebugInfo/DWARF/DWARFContext.h"
19
20
#include " llvm/DebugInfo/DWARF/DWARFDebugLine.h"
20
21
#include " llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
@@ -33,25 +34,7 @@ namespace classic {
33
34
class DeclContextTree ;
34
35
35
36
using Offset2UnitMap = DenseMap<uint64_t , CompileUnit *>;
36
-
37
- struct DebugDieValuePool {
38
- DenseMap<uint64_t , uint64_t > DieValueMap;
39
- SmallVector<uint64_t > DieValues;
40
-
41
- uint64_t getValueIndex (uint64_t Value) {
42
- DenseMap<uint64_t , uint64_t >::iterator It = DieValueMap.find (Value);
43
- if (It == DieValueMap.end ()) {
44
- It = DieValueMap.insert (std::make_pair (Value, DieValues.size ())).first ;
45
- DieValues.push_back (Value);
46
- }
47
- return It->second ;
48
- }
49
-
50
- void clear () {
51
- DieValueMap.clear ();
52
- DieValues.clear ();
53
- }
54
- };
37
+ using DebugDieValuePool = IndexedValuesMap<uint64_t >;
55
38
56
39
// / DwarfEmitter presents interface to generate all debug info tables.
57
40
class DwarfEmitter {
Original file line number Diff line number Diff line change 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- #ifndef LLVM_LIB_DWARFLINKER_PARALLEL_INDEXEDVALUESMAP_H
10
- #define LLVM_LIB_DWARFLINKER_PARALLEL_INDEXEDVALUESMAP_H
9
+ #ifndef LLVM_DWARFLINKER_INDEXEDVALUESMAP_H
10
+ #define LLVM_DWARFLINKER_INDEXEDVALUESMAP_H
11
11
12
12
#include " llvm/ADT/DenseMap.h"
13
13
#include " llvm/ADT/SmallVector.h"
16
16
17
17
namespace llvm {
18
18
namespace dwarf_linker {
19
- namespace parallel {
20
19
20
+ // / This class stores values sequentually and assigns index to the each value.
21
21
template <typename T> class IndexedValuesMap {
22
22
public:
23
23
uint64_t getValueIndex (T Value) {
@@ -29,7 +29,7 @@ template <typename T> class IndexedValuesMap {
29
29
return It->second ;
30
30
}
31
31
32
- const SmallVector<T> &getValues () { return Values; }
32
+ const SmallVector<T> &getValues () const { return Values; }
33
33
34
34
void clear () {
35
35
ValueToIndexMap.clear ();
@@ -44,8 +44,7 @@ template <typename T> class IndexedValuesMap {
44
44
SmallVector<T> Values;
45
45
};
46
46
47
- } // end of namespace parallel
48
47
} // end of namespace dwarf_linker
49
48
} // end of namespace llvm
50
49
51
- #endif // LLVM_LIB_DWARFLINKER_PARALLEL_INDEXEDVALUESMAP_H
50
+ #endif // LLVM_DWARFLINKER_INDEXEDVALUESMAP_H
Original file line number Diff line number Diff line change @@ -2035,13 +2035,13 @@ void DWARFLinker::DIECloner::emitDebugAddrSection(
2035
2035
if (DwarfVersion < 5 )
2036
2036
return ;
2037
2037
2038
- if (AddrPool.DieValues .empty ())
2038
+ if (AddrPool.getValues () .empty ())
2039
2039
return ;
2040
2040
2041
2041
MCSymbol *EndLabel = Emitter->emitDwarfDebugAddrsHeader (Unit);
2042
2042
patchAddrBase (*Unit.getOutputUnitDIE (),
2043
2043
DIEInteger (Emitter->getDebugAddrSectionSize ()));
2044
- Emitter->emitDwarfDebugAddrs (AddrPool.DieValues ,
2044
+ Emitter->emitDwarfDebugAddrs (AddrPool.getValues () ,
2045
2045
Unit.getOrigUnit ().getAddressByteSize ());
2046
2046
Emitter->emitDwarfDebugAddrsFooter (Unit, EndLabel);
2047
2047
}
@@ -2867,7 +2867,7 @@ Error DWARFLinker::link() {
2867
2867
if (TheDwarfEmitter != nullptr ) {
2868
2868
TheDwarfEmitter->emitAbbrevs (Abbreviations, Options.TargetDWARFVersion );
2869
2869
TheDwarfEmitter->emitStrings (DebugStrPool);
2870
- TheDwarfEmitter->emitStringOffsets (StringOffsetPool.DieValues ,
2870
+ TheDwarfEmitter->emitStringOffsets (StringOffsetPool.getValues () ,
2871
2871
Options.TargetDWARFVersion );
2872
2872
TheDwarfEmitter->emitLineStrings (DebugLineStrPool);
2873
2873
for (AccelTableKind TableKind : Options.AccelTables ) {
Original file line number Diff line number Diff line change 10
10
#define LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERUNIT_H
11
11
12
12
#include " DWARFLinkerGlobalData.h"
13
- #include " IndexedValuesMap.h"
14
13
#include " OutputSections.h"
15
14
#include " llvm/CodeGen/DIE.h"
15
+ #include " llvm/DWARFLinker/IndexedValuesMap.h"
16
16
#include " llvm/DWARFLinker/Parallel/DWARFLinker.h"
17
17
#include " llvm/DWARFLinker/StringPool.h"
18
18
#include " llvm/DebugInfo/DWARF/DWARFUnit.h"
You can’t perform that action at this time.
0 commit comments