LLVM: lib/DWARFLinker/Parallel/DWARFLinkerTypeUnit.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DWARFLINKER_PARALLEL_DWARFLINKERTYPEUNIT_H
10#define LLVM_DWARFLINKER_PARALLEL_DWARFLINKERTYPEUNIT_H
11
16
17namespace llvm {
20
21
22
23
25public:
29
30
32
33
35
36
38
39
40
41
42
43
44
45
53
54
55 void
58
59 assert(Info.TypeEntryBodyPtr != nullptr);
60
61 if (&Info.TypeEntryBodyPtr->getFinalDie() != Info.OutDIE)
62 return;
63
64 Info.OutOffset = Info.OutDIE->getOffset();
65 Handler(Info);
66 });
67 }
68
69
71 std::unique_lockstd::mutex LockGuard(DebugStringIndexMapMutex);
73 }
74
75
77 AcceleratorRecords.add(Info);
78 }
79
80private:
81
82
83
86
87
88 void prepareDataForTreeCreation();
89
90
91
93
94 std::pair<dwarf::Form, uint8_t> getScalarFormForValue(uint64_t Value) const;
95
97
98 struct CmpStringEntryRef {
100 return LHS->first() < RHS->first();
101 }
102 };
103 struct CmpDirIDStringEntryRef {
104 bool operator()(const std::pair<StringEntry *, uint64_t> &LHS,
105 const std::pair<StringEntry *, uint64_t> &RHS) const {
106 return LHS.second < RHS.second ||
107 (!(RHS.second < LHS.second) &&
108 LHS.first->first() < RHS.first->first());
109 }
110 };
111
112
113 std::optional<uint16_t> Language;
114
115
116 DWARFDebugLine::LineTable LineTable;
117
118
119 using DirectoriesMapTy = std::map<StringEntry *, size_t, CmpStringEntryRef>;
120 using FilenamesMapTy = std::map<std::pair<StringEntry *, uint64_t>, size_t,
121 CmpDirIDStringEntryRef>;
122
123 DirectoriesMapTy DirectoriesMap;
124 FilenamesMapTy FileNamesMap;
125
126
127 TypePool Types;
128
129
130 ArrayList AcceleratorRecords;
131
132
133 std::mutex DebugStringIndexMapMutex;
134};
135
136}
137}
138}
139
140#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
A structured debug information entry.
Lightweight error class with error context and mandatory checking.
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
IndexedValuesMap< const StringEntry * > DebugStringIndexMap
Maps a string into the index inside .debug_str_offsets section.
unsigned ID
Unique ID for the unit.
DwarfUnit(LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName)
This class keeps data and services common for the whole linking process.
LinkingGlobalData & GlobalData
dwarf::FormParams Format
Format for sections.
Keeps cloned data for the type DIE.
TypePool keeps type descriptors which contain partially cloned DIE correspinding to each type.
void saveAcceleratorInfo(const TypeUnitAccelInfo &Info)
Adds Info to the unit's accelerator records.
Definition DWARFLinkerTypeUnit.h:76
TypePool & getTypePool()
Returns global type pool.
Definition DWARFLinkerTypeUnit.h:37
Error finishCloningAndEmit(const Triple &TargetTriple)
Emits resulting dwarf based on information from DIE tree.
uint64_t getDebugStrIndex(const StringEntry *String) override
Returns index for the specified String inside .debug_str_offsets.
Definition DWARFLinkerTypeUnit.h:70
void createDIETree(BumpPtrAllocator &Allocator)
Generates DIE tree based on information from TypesMap.
void forEachAcceleratorRecord(function_ref< void(AccelInfo &)> Handler) override
Enumerates all accelerator records and call Handler for each.
Definition DWARFLinkerTypeUnit.h:56
TypeUnit(LinkingGlobalData &GlobalData, unsigned ID, std::optional< uint16_t > Language, dwarf::FormParams Format, llvm::endianness Endianess)
An efficient, type-erasing, non-owning reference to a callable.
StringMapEntry< std::atomic< TypeEntryBody * > > TypeEntry
StringMapEntry< EmptyStringSetTag > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
This structure keeps fields which would be used for creating accelerator table.
TypeUnitAccelInfo extends AccelInfo structure with type specific fileds.
Definition DWARFLinkerTypeUnit.h:46
DIE * OutDIE
Pointer to the output DIE which owns this accelerator record.
Definition DWARFLinkerTypeUnit.h:48
TypeEntryBody * TypeEntryBodyPtr
Pointer to the type entry body.
Definition DWARFLinkerTypeUnit.h:51