LLVM: include/llvm/DebugInfo/DWARF/LowLevel/DWARFDataExtractorSimple.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_DEBUGINFO_DWARF_LOWLEVEL_DWARFDATAEXTRACTORSIMPLE_H

10#define LLVM_DEBUGINFO_DWARF_LOWLEVEL_DWARFDATAEXTRACTORSIMPLE_H

11

17

18namespace llvm {

19

20

21

22

23template

25

26public:

34 IsLittleEndian, AddressSize) {}

35

36

40

41

43 uint64_t *SectionIndex = nullptr,

44 Error *Err = nullptr) const {

45 return static_cast<const Relocator *>(this)->getRelocatedValueImpl(

46 Size, Off, SectionIndex, Err);

47 }

48

50 uint64_t *SectionIndex = nullptr) const {

52 }

53

54

58

63

64

65

66

67

68

69 std::pair<uint64_t, dwarf::DwarfFormat>

72 if (Err && *Err)

74

83 if (Err)

85 std::errc::invalid_argument,

86 "unsupported reserved unit length of value 0x%8.8" PRIx64, Length);

88 }

89

90 if (C) {

91 *Off = C.tell();

93 }

94 if (Err)

95 *Err = C.takeError();

96 else

99 }

100

104

105

106

107

108

110 uint64_t PCRelOffset) const {

112 return std::nullopt;

113

116

117 switch (Encoding & 0x0F) {

120 case 2:

121 case 4:

122 case 8:

124 break;

125 default:

126 return std::nullopt;

127 }

128 break;

131 break;

134 break;

137 break;

140 break;

143 break;

146 break;

149 break;

152 break;

153 default:

154 return std::nullopt;

155 }

156

157 switch (Encoding & 0x70) {

159

160 break;

162 Result += PCRelOffset;

163 break;

168 default:

170 return std::nullopt;

171 }

172

173 return Result;

174 }

175};

176

177

178

179

182public:

184

186 uint64_t *SectionIndex = nullptr,

187 Error *Err = nullptr) const {

188 assert(SectionIndex == nullptr &&

189 "DWARFDATAExtractorSimple cannot take section indices.");

191 }

192};

193

194}

195#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file contains constants used for implementing Dwarf debug support.

static StringRef substr(StringRef Str, uint64_t Len)

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

Helper for Errors used as out-parameters.

Lightweight error class with error context and mandatory checking.

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

@ C

The default llvm calling convention, compatible with C.

DwarfFormat

Constants that define the DWARF format as 32 or 64 bit.

@ DW_LENGTH_lo_reserved

Special values for an initial length field.

@ DW_LENGTH_DWARF64

Indicator of 64-bit DWARF format.

This is an optimization pass for GlobalISel generic memory operations.

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

void cantFail(Error Err, const char *Msg=nullptr)

Report a fatal error if Err is a failure value.

constexpr int64_t SignExtend64(uint64_t x)

Sign-extend the number in the bottom B bits of X to a 64-bit integer.

void consumeError(Error Err)

Consume a Error without doing anything.