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

1

2

3

4

5

6

7

8

9#ifndef LLVM_MC_MCFIXUP_H

10#define LLVM_MC_MCFIXUP_H

11

16#include

17

18namespace llvm {

20

21

23enum {

24

25

26

27

28

30

31

32

33 FK_NONE = 4000,

39 FK_SecRel_1,

40 FK_SecRel_2,

41 FK_SecRel_4,

42 FK_SecRel_8,

43

45};

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

62

63

64

65 const MCExpr *Value = nullptr;

66

67

69

70

71

73

74

75

76

77 bool PCRel = false;

78

79

80

81 bool LinkerRelaxable = false;

82

83

84

85public:

87 bool PCRel = false) {

89 FI.Value = Value;

90 FI.Offset = Offset;

91 FI.Kind = Kind;

92 FI.PCRel = PCRel;

93 return FI;

94 }

95

97

100

102

103 bool isPCRel() const { return PCRel; }

107

108

109

111 switch (Size) {

113 case 1:

115 case 2:

117 case 4:

119 case 8:

121 }

122 }

123

125};

126

128

129

131

132

133

134

138}

139

140}

141

142#endif

Base class for the full range of assembler expressions which are needed for parsing.

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

Definition MCFixup.h:61

static MCFixupKind getDataKindForSize(unsigned Size)

Return the generic fixup kind for a value with the given size.

Definition MCFixup.h:110

void setPCRel()

Definition MCFixup.h:104

const MCExpr * getValue() const

Definition MCFixup.h:101

void setLinkerRelaxable()

Definition MCFixup.h:106

LLVM_ABI SMLoc getLoc() const

uint32_t getOffset() const

Definition MCFixup.h:98

bool isPCRel() const

Definition MCFixup.h:103

bool isLinkerRelaxable() const

Definition MCFixup.h:105

void setOffset(uint32_t Value)

Definition MCFixup.h:99

static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, bool PCRel=false)

Consider bit fields if we need more flags.

Definition MCFixup.h:86

MCFixupKind getKind() const

Definition MCFixup.h:96

Represents a location in source code.

#define llvm_unreachable(msg)

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

bool isRelocRelocation(MCFixupKind FixupKind)

Definition MCFixup.h:135

bool isRelocation(MCFixupKind FixupKind)

Definition MCFixup.h:130

This is an optimization pass for GlobalISel generic memory operations.

uint16_t MCFixupKind

Extensible enumeration to represent the type of a fixup.

Definition MCFixup.h:22

static Lanai::Fixups FixupKind(const MCExpr *Expr)

@ FirstTargetFixupKind

Definition MCFixup.h:44

@ FK_SecRel_2

A two-byte section relative fixup.

Definition MCFixup.h:40

@ FirstLiteralRelocationKind

Definition MCFixup.h:29

@ FK_Data_8

A eight-byte fixup.

Definition MCFixup.h:37

@ FK_Data_1

A one-byte fixup.

Definition MCFixup.h:34

@ FK_Data_4

A four-byte fixup.

Definition MCFixup.h:36

@ FK_SecRel_8

A eight-byte section relative fixup.

Definition MCFixup.h:42

@ FK_NONE

A no-op fixup.

Definition MCFixup.h:33

@ FK_SecRel_4

A four-byte section relative fixup.

Definition MCFixup.h:41

@ FK_SecRel_1

A one-byte section relative fixup.

Definition MCFixup.h:39

@ FK_Data_leb128

A leb128 fixup.

Definition MCFixup.h:38

@ FK_Data_2

A two-byte fixup.

Definition MCFixup.h:35