9#ifndef LLVM_DWARFLINKER_PARALLEL_DWARFLINKERTYPEUNIT_H
10#define LLVM_DWARFLINKER_PARALLEL_DWARFLINKERTYPEUNIT_H
61 if (&
Info.TypeEntryBodyPtr->getFinalDie() !=
Info.OutDIE)
64 Info.OutOffset =
Info.OutDIE->getOffset();
71 std::unique_lock<std::mutex> LockGuard(DebugStringIndexMapMutex);
77 AcceleratorRecords.add(
Info);
88 void prepareDataForTreeCreation();
94 std::pair<dwarf::Form, uint8_t> getScalarFormForValue(
uint64_t Value)
const;
98 struct CmpStringEntryRef {
100 return LHS->first() <
RHS->first();
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());
113 std::optional<uint16_t> Language;
116 DWARFDebugLine::LineTable LineTable;
119 using DirectoriesMapTy = std::map<StringEntry *, size_t, CmpStringEntryRef>;
120 using FilenamesMapTy = std::map<std::pair<StringEntry *, uint64_t>, size_t,
121 CmpDirIDStringEntryRef>;
123 DirectoriesMapTy DirectoriesMap;
124 FilenamesMapTy FileNamesMap;
130 ArrayList<TypeUnitAccelInfo> AcceleratorRecords;
133 std::mutex DebugStringIndexMapMutex;
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.
TypePool & getTypePool()
Returns global type pool.
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.
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.
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< std::nullopt_t > 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.
This structure keeps fields which would be used for creating accelerator table.
TypeUnitAccelInfo extends AccelInfo structure with type specific fileds.
DIE * OutDIE
Pointer to the output DIE which owns this accelerator record.
TypeEntryBody * TypeEntryBodyPtr
Pointer to the type entry body.