LLVM: lib/DWARFLinker/Parallel/DWARFLinkerUnit.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERUNIT_H

10#define LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERUNIT_H

11

20

21namespace llvm {

24

27

28

30public:

36

37

39

40

42

43

45

46

48

49

51

52

54

55

57

58

59

61

62

64

65

67

68

72

73

75

76

85

86

88

89

90

91

92

94

95

97

98

101

102

104

105

106

107

108

110

112

113

114

115

116

117

119

120

121

127

128

130

131

133

134

136

137

139

140

142

143

145

146

148 };

149

150

152

153

154 virtual void

156

157

158

159

163

164protected:

165

168

169

170 std::optional<uint64_t>

172 std::optional<uint64_t> LengthOffset);

173

174

176

177

179

180

182

183

185

187

188

190

191

193

194

196

197

199

200

202

203

207

208

210};

211

213 switch (Language) {

214 case dwarf::DW_LANG_C_plus_plus:

215 case dwarf::DW_LANG_C_plus_plus_03:

216 case dwarf::DW_LANG_C_plus_plus_11:

217 case dwarf::DW_LANG_C_plus_plus_14:

218 case dwarf::DW_LANG_ObjC_plus_plus:

219 return true;

220 default:

221 return false;

222 };

223

224 return false;

225}

226

227}

228}

229}

230

231#endif

Analysis containing CSE Info

Dwarf abbreviation, describes the organization of a debug information object.

A structured debug information entry.

Lightweight error class with error context and mandatory checking.

FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...

StringRef - Represent a constant reference to a string, i.e.

Triple - Helper class for working with autoconf configuration names.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

This class stores values sequentually and assigns index to the each value.

Base class for all Dwarf units(Compile unit/Type table unit).

Definition DWARFLinkerUnit.h:29

FileNamesCache FileNames

Definition DWARFLinkerUnit.h:206

unsigned getUniqueID() const

Unique id of the unit.

Definition DWARFLinkerUnit.h:38

DenseMap< uint64_t, std::pair< std::string, std::string > > FileNamesCache

Cache for file names for this unit.

Definition DWARFLinkerUnit.h:204

std::string UnitName

The name of this unit.

Definition DWARFLinkerUnit.h:178

LinkingGlobalData & getGlobalData()

Return global data.

Definition DWARFLinkerUnit.h:56

std::vector< std::unique_ptr< DIEAbbrev > > Abbreviations

Storage for the unique Abbreviations.

Definition DWARFLinkerUnit.h:198

dwarf::Tag getTag() const

Returns unit DWARF tag.

Definition DWARFLinkerUnit.h:87

DIE * OutUnitDIE

Output unit DIE.

Definition DWARFLinkerUnit.h:201

std::string SysRoot

The DW_AT_LLVM_sysroot of this unit.

Definition DWARFLinkerUnit.h:181

bool isClangModule() const

Return true if this compile unit is from Clang module.

Definition DWARFLinkerUnit.h:50

uint64_t getUnitSize() const

Returns size of this(newly generated) compile unit.

Definition DWARFLinkerUnit.h:41

void assignAbbrev(DIEAbbrev &Abbrev)

Adds Abbrev into unit`s abbreviation table.

void setInterconnectedCU()

Mark this unit as inter-connected(it references/referenced by other unit).

Definition DWARFLinkerUnit.h:63

IndexedValuesMap< const StringEntry * > DebugStringIndexMap

Maps a string into the index inside .debug_str_offsets section.

Definition DWARFLinkerUnit.h:209

std::optional< uint64_t > emitPubAcceleratorEntry(SectionDescriptor &OutSection, const AccelInfo &Info, std::optional< uint64_t > LengthOffset)

Emit single pubnames/pubtypes accelerator entry.

virtual ~DwarfUnit()=default

unsigned ID

Unique ID for the unit.

Definition DWARFLinkerUnit.h:175

StringRef getUnitName() const

Returns this unit name.

Definition DWARFLinkerUnit.h:44

const std::string & getClangModuleName() const

Return Clang module name;.

Definition DWARFLinkerUnit.h:53

uint64_t UnitSize

Definition DWARFLinkerUnit.h:186

std::atomic< bool > IsInterconnectedCU

true if current unit references_to/is_referenced by other unit.

Definition DWARFLinkerUnit.h:192

void setOutUnitDIE(DIE *UnitDie)

Set output unit DIE.

Definition DWARFLinkerUnit.h:77

DwarfUnit(LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName)

Definition DWARFLinkerUnit.h:32

std::string ClangModuleName

If this is a Clang module, this holds the module's name.

Definition DWARFLinkerUnit.h:184

dwarf::Tag UnitTag

DWARF unit tag.

Definition DWARFLinkerUnit.h:189

bool isInterconnectedCU() const

Returns true if unit is inter-connected(it references/referenced by other unit).

Definition DWARFLinkerUnit.h:60

virtual uint64_t getDebugStrIndex(const StringEntry *String)

Returns index(inside .debug_str_offsets) of specified string.

Definition DWARFLinkerUnit.h:160

const std::vector< std::unique_ptr< DIEAbbrev > > & getAbbreviations() const

Returns abbreviations for this compile unit.

Definition DWARFLinkerUnit.h:69

void emitDwarfAbbrevEntry(const DIEAbbrev &Abbrev, SectionDescriptor &AbbrevSection)

Emit single abbreviation entry.

FoldingSet< DIEAbbrev > AbbreviationsSet

FoldingSet that uniques the abbreviations.

Definition DWARFLinkerUnit.h:195

StringRef getSysRoot()

Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.

Definition DWARFLinkerUnit.h:47

DIE * getOutUnitDIE()

Returns output unit DIE.

Definition DWARFLinkerUnit.h:74

This class keeps data and services common for the whole linking process.

OutputSections(LinkingGlobalData &GlobalData)

LinkingGlobalData & GlobalData

uint16_t getDebugInfoHeaderSize() const

Return size of header of debug_info table.

An efficient, type-erasing, non-owning reference to a callable.

AccelType

Definition DWARFLinkerUnit.h:118

Error emitDebugInfo(const Triple &TargetTriple)

Emit .debug_info section for unit DIEs.

Error emitDebugStringOffsetSection()

Emit the .debug_str_offsets section for current unit.

virtual void forEachAcceleratorRecord(function_ref< void(AccelInfo &)> Handler)=0

Enumerates accelerator data.

void emitPubAccelerators()

Emit .debug_pubnames and .debug_pubtypes for Unit.

void error(const Twine &Err)

Definition DWARFLinkerUnit.h:111

void warn(const Twine &Warning)

Definition DWARFLinkerUnit.h:109

Error emitAbbreviations()

Error emitDebugLine(const Triple &TargetTriple, const DWARFDebugLine::LineTable &OutLineTable)

Emit .debug_line section.

@ Name

Definition DWARFLinkerUnit.h:118

@ None

Definition DWARFLinkerUnit.h:118

@ Type

Definition DWARFLinkerUnit.h:118

@ Namespace

Definition DWARFLinkerUnit.h:118

@ ObjC

Definition DWARFLinkerUnit.h:118

bool isODRLanguage(uint16_t Language)

Definition DWARFLinkerUnit.h:212

DenseMap< uint64_t, DwarfUnit * > MacroOffset2UnitMapTy

Definition DWARFLinkerUnit.h:26

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.

This structure keeps fields which would be used for creating accelerator table.

Definition DWARFLinkerUnit.h:122

bool AvoidForPubSections

Avoid emitting this entry for pub sections.

Definition DWARFLinkerUnit.h:144

StringEntry * String

Name of the entry.

Definition DWARFLinkerUnit.h:129

uint64_t OutOffset

Output offset of the DIE this entry describes.

Definition DWARFLinkerUnit.h:132

AccelType Type

Type of this accelerator record.

Definition DWARFLinkerUnit.h:141

uint32_t QualifiedNameHash

Hash of the fully qualified name.

Definition DWARFLinkerUnit.h:135

AccelInfo()

Definition DWARFLinkerUnit.h:123

bool ObjcClassImplementation

Is this an ObjC class implementation?

Definition DWARFLinkerUnit.h:147

dwarf::Tag Tag

Tag of the DIE this entry describes.

Definition DWARFLinkerUnit.h:138

This structure is used to keep data of the concrete section.