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

1

2

3

4

5

6

7

8

9#ifndef LLVM_MC_MCASMBACKEND_H

10#define LLVM_MC_MCASMBACKEND_H

11

17#include

18

19namespace llvm {

20

36

37

39

40

42

43

45

46

47

49

50

52};

53

54

56protected:

58

60

63

64public:

68

70

72

74

75

76

78

79

80

82

83

85

86

87

88 std::unique_ptr

90

91

92

93

94 std::unique_ptr

96

97 virtual std::unique_ptr

99

100

101

102

103

105

106

108

109

110

111

116

119

120

121

122

123

126 bool IsResolved) = 0;

127

128

129

130

131

132

133

134

139

140

141

142 virtual bool fixupNeedsRelaxationAdvanced(const MCFragment &, const MCFixup &,

144 bool Resolved) const;

145

146

151

152

153

154

155

156

160 "Needed if fixupNeedsRelaxation/fixupNeedsRelaxationAdvanced may "

161 "return true");

162 }

163

164

165

166

167

172

173

174

176 int64_t &Value) const {

177 return std::make_pair(false, false);

178 }

179

180

181

182

183

184

185

187

188

189

193

194

195

196

197

200

201

202

204

205

210

211 bool isDarwinCanonicalPersonality(const MCSymbol *Sym) const;

212

213

215};

216

217}

218

219#endif

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

PowerPC TLS Dynamic Call Fixup

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

virtual unsigned getMinimumNopSize() const

Returns the minimum size of a nop in bytes on this target.

Definition MCAsmBackend.h:186

MCAsmBackend(const MCAsmBackend &)=delete

const llvm::endianness Endian

Definition MCAsmBackend.h:69

bool allowEnhancedRelaxation() const

Return true if this target allows an unrelaxable instruction to be emitted into RelaxableFragment and...

Definition MCAsmBackend.h:81

bool allowAutoPadding() const

Return true if this target might automatically pad instructions and thus need to emit padding enable/...

Definition MCAsmBackend.h:77

virtual unsigned getMaximumNopSize(const MCSubtargetInfo &STI) const

Returns the maximum size of a nop in bytes on this target.

Definition MCAsmBackend.h:190

virtual bool writeNopData(raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const =0

Write an (optimal) nop sequence of Count bytes to the given output.

virtual void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const

Relax the instruction in the given fragment to the next wider instruction.

Definition MCAsmBackend.h:157

MCAsmBackend(llvm::endianness Endian)

Definition MCAsmBackend.h:57

virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const

Get information on a fixup kind.

virtual bool relaxAlign(MCFragment &F, unsigned &Size)

Definition MCAsmBackend.h:168

virtual bool mayNeedRelaxation(unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI) const

Check whether the given instruction (encoded as Opcode+Operands) may need relaxation.

Definition MCAsmBackend.h:135

virtual std::pair< bool, bool > relaxLEB128(MCFragment &, int64_t &Value) const

Definition MCAsmBackend.h:175

bool AllowEnhancedRelaxation

Definition MCAsmBackend.h:62

virtual bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value) const

Simple predicate for targets where !Resolved implies requiring relaxation.

Definition MCAsmBackend.h:147

virtual bool relaxSFrameCFA(MCFragment &) const

Definition MCAsmBackend.h:171

MCAsmBackend & operator=(const MCAsmBackend &)=delete

virtual bool relaxDwarfCFA(MCFragment &) const

Definition MCAsmBackend.h:170

virtual std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const =0

bool AllowAutoPadding

Definition MCAsmBackend.h:61

virtual bool finishLayout() const

Definition MCAsmBackend.h:203

MCAssembler * Asm

Definition MCAsmBackend.h:59

virtual void reset()

lifetime management

Definition MCAsmBackend.h:84

void setAssembler(MCAssembler *A)

Definition MCAsmBackend.h:71

virtual std::optional< MCFixupKind > getFixupKind(StringRef Name) const

Map a relocation name used in .reloc to a fixup kind.

virtual void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved)=0

virtual std::optional< bool > evaluateFixup(const MCFragment &, MCFixup &, MCValue &, uint64_t &)

Definition MCAsmBackend.h:112

virtual uint64_t generateCompactUnwindEncoding(const MCDwarfFrameInfo *FI, const MCContext *Ctxt) const

Generate the compact unwind encoding for the CFI instructions.

Definition MCAsmBackend.h:206

virtual bool relaxDwarfLineAddr(MCFragment &) const

Definition MCAsmBackend.h:169

Context object for machine code objects.

Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...

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

Streaming object file generation interface.

Base class for classes that define behaviour that is specific to both the target and the object forma...

Defines the object file and target independent interfaces used by the assembler backend to write nati...

Instances of this class represent operands of the MCInst class.

Generic base class for all target subtargets.

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

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

Target - Wrapper for Target specific information.

LLVM Value Representation.

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

An abstract base class for streams implementations that also support a pwrite operation.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

This is an optimization pass for GlobalISel generic memory operations.

uint16_t MCFixupKind

Extensible enumeration to represent the type of a fixup.

FunctionAddr VTableAddr Count

FunctionAddr VTableAddr uintptr_t uintptr_t Data

Target independent information on a fixup kind.

Definition MCAsmBackend.h:38

const char * Name

A target specific name for the fixup kind.

Definition MCAsmBackend.h:41

uint8_t TargetOffset

The bit offset to write the relocation into.

Definition MCAsmBackend.h:44

uint8_t TargetSize

The number of bits written by this fixup.

Definition MCAsmBackend.h:48

unsigned Flags

Flags describing additional information on this fixup kind.

Definition MCAsmBackend.h:51