LLVM: lib/MC/MCSymbolELF.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

11

12namespace llvm {

13

14namespace {

15enum {

16

17 ELF_STT_Shift = 0,

18

19

20 ELF_STB_Shift = 3,

21

22

23 ELF_STV_Shift = 5,

24

25

26

27 ELF_STO_Shift = 7,

28

29

30 ELF_IsSignature_Shift = 10,

31

32

33 ELF_Weakref_Shift = 11,

34

35

36 ELF_BindingSet_Shift = 12,

37

38

39 ELF_IsMemoryTagged_Shift = 13,

40};

41}

42

44 setIsBindingSet();

45 unsigned Val;

47 default:

50 Val = 0;

51 break;

53 Val = 1;

54 break;

56 Val = 2;

57 break;

59 Val = 3;

60 break;

61 }

63 setFlags(OtherFlags | (Val << ELF_STB_Shift));

64}

65

69 switch (Val) {

70 default:

72 case 0:

74 case 1:

76 case 2:

78 case 3:

80 }

81 }

82

90}

91

93 unsigned Val;

94 switch (Type) {

95 default:

98 Val = 0;

99 break;

101 Val = 1;

102 break;

104 Val = 2;

105 break;

107 Val = 3;

108 break;

110 Val = 4;

111 break;

113 Val = 5;

114 break;

116 Val = 6;

117 break;

118 }

120 setFlags(OtherFlags | (Val << ELF_STT_Shift));

121}

122

125 switch (Val) {

126 default:

128 case 0:

130 case 1:

132 case 2:

134 case 3:

136 case 4:

138 case 5:

140 case 6:

142 }

143}

144

148

150 setFlags(OtherFlags | (Visibility << ELF_STV_Shift));

151}

152

154 unsigned Visibility = (Flags >> ELF_STV_Shift) & 3;

155 return Visibility;

156}

157

165

167 unsigned Other = (Flags >> ELF_STO_Shift) & 7;

168 return Other << 5;

169}

170

172 uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_Weakref_Shift);

173 setFlags(OtherFlags | (1 << ELF_Weakref_Shift));

174}

175

177 return getFlags() & (0x1 << ELF_Weakref_Shift);

178}

179

181 uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_IsSignature_Shift);

182 setFlags(OtherFlags | (1 << ELF_IsSignature_Shift));

183}

184

186 return getFlags() & (0x1 << ELF_IsSignature_Shift);

187}

188

189void MCSymbolELF::setIsBindingSet() const {

190 uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_BindingSet_Shift);

191 setFlags(OtherFlags | (1 << ELF_BindingSet_Shift));

192}

193

195 return getFlags() & (0x1 << ELF_BindingSet_Shift);

196}

197

199 return getFlags() & (0x1 << ELF_IsMemoryTagged_Shift);

200}

201

203 uint32_t OtherFlags = getFlags() & ~(1 << ELF_IsMemoryTagged_Shift);

204 if (Tagged)

205 setFlags(OtherFlags | (1 << ELF_IsMemoryTagged_Shift));

206 else

208}

209}

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

DXIL Resource Implicit Binding

bool isMemtag() const

Definition MCSymbolELF.cpp:198

void setIsWeakref() const

Definition MCSymbolELF.cpp:171

unsigned getOther() const

Definition MCSymbolELF.cpp:166

unsigned getType() const

Definition MCSymbolELF.cpp:123

void setVisibility(unsigned Visibility)

Definition MCSymbolELF.cpp:145

void setMemtag(bool Tagged)

Definition MCSymbolELF.cpp:202

bool isBindingSet() const

Definition MCSymbolELF.cpp:194

void setIsSignature() const

Definition MCSymbolELF.cpp:180

void setBinding(unsigned Binding) const

Definition MCSymbolELF.cpp:43

bool isSignature() const

Definition MCSymbolELF.cpp:185

unsigned getVisibility() const

Definition MCSymbolELF.cpp:153

unsigned getBinding() const

Definition MCSymbolELF.cpp:66

void setType(unsigned Type) const

Definition MCSymbolELF.cpp:92

void setOther(unsigned Other)

Definition MCSymbolELF.cpp:158

bool isWeakref() const

Definition MCSymbolELF.cpp:176

bool isDefined() const

isDefined - Check if this symbol is defined (i.e., it has an address).

void setFlags(uint32_t Value) const

Set the (implementation defined) symbol flags.

uint32_t getFlags() const

Get the (implementation defined) symbol flags.

bool isUsedInReloc() const

The instances of the Type class are immutable: once they are created, they are never changed.

#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.