LLVM: include/llvm/MC/MCDisassembler/MCDisassembler.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H

10#define LLVM_MC_MCDISASSEMBLER_MCDISASSEMBLER_H

11

17#include

18#include

19#include

20

21namespace llvm {

22

25 std::optional<uint32_t> Index;

28};

29

33

36

38

39private:

40 bool IsXCOFF;

41 bool HasType;

42

43public:

51 IsXCOFF(IsXCOFF), HasType(true) {}

52 bool isXCOFF() const { return IsXCOFF; }

53

54private:

56 assert((P1.IsXCOFF == P2.IsXCOFF && P1.HasType == P2.HasType) &&

57 "The value of IsXCOFF and HasType in P1 and P2 should be the same "

58 "respectively.");

59

60 if (P1.IsXCOFF && P1.HasType)

61 return std::tie(P1.Addr, P1.Type, P1.Name) <

63

64 if (P1.IsXCOFF)

65 return std::tie(P1.Addr, P1.XCOFFSymInfo, P1.Name) <

67

68

69 bool MS1 = !P1.IsMappingSymbol, MS2 = !P2.IsMappingSymbol;

70 return std::tie(P1.Addr, MS1, P1.Name, P1.Type) <

72 }

73};

74

76

77template class ArrayRef;

82

83

84

86public:

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

114

117

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

138

139

140

141

142

143

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

207

208private:

210

211protected:

212

215

216public:

217

221

223

224

225

226 void setSymbolizer(std::unique_ptr Symzer);

227

229

231

232

234

235

236

238};

239

240}

241

242#endif

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

static void tryAddingPcLoadReferenceComment(uint64_t Address, int Value, const MCDisassembler *Decoder)

tryAddingPcLoadReferenceComment - trys to add a comment as to what is being referenced by a load inst...

static bool tryAddingSymbolicOperand(uint64_t Address, int32_t Value, bool isBranch, uint64_t InstSize, MCInst &MI, const MCDisassembler *Decoder)

tryAddingSymbolicOperand - trys to add a symbolic operand in place of the immediate Value in the MCIn...

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

Tagged union holding either a T or a Error.

Context object for machine code objects.

MCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)

Definition MCDisassembler.h:115

virtual DecodeStatus getInstructionBundle(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const

Returns the disassembly of an instruction bundle for VLIW architectures like Hexagon.

Definition MCDisassembler.h:144

virtual void setABIVersion(unsigned Version)

ELF-specific, set the ABI version from the object header.

Definition MCDisassembler.h:233

MCContext & getContext() const

Definition MCDisassembler.h:228

const MCSubtargetInfo & getSubtargetInfo() const

Definition MCDisassembler.h:230

std::unique_ptr< MCSymbolizer > Symbolizer

Definition MCDisassembler.h:214

const MCSubtargetInfo & STI

Definition MCDisassembler.h:213

raw_ostream * CommentStream

Definition MCDisassembler.h:237

void setSymbolizer(std::unique_ptr< MCSymbolizer > Symzer)

Set Symzer as the current symbolizer.

DecodeStatus

Ternary decode status.

Definition MCDisassembler.h:109

@ Fail

Definition MCDisassembler.h:110

@ SoftFail

Definition MCDisassembler.h:111

@ Success

Definition MCDisassembler.h:112

virtual DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const =0

Returns the disassembly of a single instruction.

virtual ~MCDisassembler()

Instances of this class represent a single low-level machine instruction.

Generic base class for all target subtargets.

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

LLVM Value Representation.

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr uintptr_t uintptr_t Version

std::vector< SymbolInfoTy > SectionSymbolsTy

Definition MCDisassembler.h:75

SymInfo contains information about symbol: it's address and section index which is -1LL for absolute ...

Definition MCDisassembler.h:30

SymbolInfoTy(std::optional< XCOFF::StorageMappingClass > Smc, uint64_t Addr, StringRef Name, std::optional< uint32_t > Idx, bool Label)

Definition MCDisassembler.h:44

SymbolInfoTy(uint64_t Addr, StringRef Name, uint8_t Type, bool IsMappingSymbol=false, bool IsXCOFF=false)

Definition MCDisassembler.h:48

XCOFFSymbolInfoTy XCOFFSymInfo

Definition MCDisassembler.h:34

bool IsMappingSymbol

Definition MCDisassembler.h:37

friend bool operator<(const SymbolInfoTy &P1, const SymbolInfoTy &P2)

Definition MCDisassembler.h:55

bool isXCOFF() const

Definition MCDisassembler.h:52

StringRef Name

Definition MCDisassembler.h:32

uint8_t Type

Definition MCDisassembler.h:35

uint64_t Addr

Definition MCDisassembler.h:31

Definition MCDisassembler.h:23

bool IsLabel

Definition MCDisassembler.h:26

LLVM_ABI bool operator<(const XCOFFSymbolInfoTy &SymInfo) const

The function is for symbol sorting when symbols have the same address.

std::optional< uint32_t > Index

Definition MCDisassembler.h:25

std::optional< XCOFF::StorageMappingClass > StorageMappingClass

Definition MCDisassembler.h:24