LLVM: include/llvm/IR/Constant.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_IR_CONSTANT_H

14#define LLVM_IR_CONSTANT_H

15

20

21namespace llvm {

22

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

44protected:

47

49

50public:

53

54

56

57

59

60

61

63

64

65

67

68

69

71

72

74

75

76

78

79

81

82

84

85

86

87

89

90

91

92

94

95

96

98

99

100

102

103

104

105

106

108

109

110

111

112

114

115

116

118

119

120

122

123

124

126

127

129

130

132

133

134

136

137

138

139

140

141

142

145

146

147

148

149

152

153

154

155

157

158

159

161

162

163

165

166

167

168

169

170

171

172

174

175

177 static_assert(ConstantFirstVal == 0, "V->getValueID() >= ConstantFirstVal always succeeds");

178 return V->getValueID() <= ConstantLastVal;

179 }

180

181

182

183

184

185

186

187

188

189

190

192

194

195

196

197

199

200

201

203

204

205

206

207

209

210

211

212

213

215

216

217

218

219

221

225

227 return const_cast<Constant*>(

228 static_cast<const Constant *>(this)->stripPointerCasts());

229 }

230

231

232

235

236

237

238

239

241

242

243

245

246private:

247 enum PossibleRelocationsTy {

248

249

250 NoRelocation = 0,

251

252

253

254 LocalRelocation = 1,

255

256

257

258 GlobalRelocation = 2,

259 };

260

261

262 PossibleRelocationsTy getRelocationInfo() const;

263

264 bool hasNLiveUses(unsigned N) const;

265};

266

267}

268

269#endif

static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")

Class for arbitrary precision integers.

This class represents a range of values.

This is an important base class in LLVM.

Definition Constant.h:43

static LLVM_ABI Constant * getIntegerValue(Type *Ty, const APInt &V)

Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...

LLVM_ABI bool hasExactInverseFP() const

Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplica...

static LLVM_ABI Constant * replaceUndefsWith(Constant *C, Constant *Replacement)

Try to replace undefined constant C or undefined elements in C with Replacement.

void operator=(const Constant &)=delete

LLVM_ABI Constant * getSplatValue(bool AllowPoison=false) const

If all elements of the vector constant have the same value, return that value.

LLVM_ABI bool containsUndefElement() const

Return true if this is a vector constant that includes any strictly undef (not poison) elements.

static LLVM_ABI Constant * mergeUndefsWith(Constant *C, Constant *Other)

Merges undefs of a Constant with another Constant, along with the undefs already present.

Constant(const Constant &)=delete

LLVM_ABI ConstantRange toConstantRange() const

Convert constant to an approximate constant range.

static LLVM_ABI Constant * getAllOnesValue(Type *Ty)

LLVM_ABI bool hasZeroLiveUses() const

Return true if the constant has no live uses.

LLVM_ABI bool isOneValue() const

Returns true if the value is one.

LLVM_ABI bool isManifestConstant() const

Return true if a constant is ConstantData or a ConstantAggregate or ConstantExpr that contain only Co...

LLVM_ABI bool isNegativeZeroValue() const

Return true if the value is what would be returned by getZeroValueForNegation.

LLVM_ABI bool isAllOnesValue() const

Return true if this is the value that would be returned by getAllOnesValue.

Constant(Type *ty, ValueTy vty, AllocInfo AllocInfo)

Definition Constant.h:45

const Constant * stripPointerCasts() const

Definition Constant.h:222

LLVM_ABI bool isMaxSignedValue() const

Return true if the value is the largest signed value.

Constant * stripPointerCasts()

Definition Constant.h:226

LLVM_ABI bool hasOneLiveUse() const

Return true if the constant has exactly one live use.

LLVM_ABI bool needsRelocation() const

This method classifies the entry according to whether or not it may generate a relocation entry (eith...

LLVM_ABI bool isDLLImportDependent() const

Return true if the value is dependent on a dllimport variable.

LLVM_ABI const APInt & getUniqueInteger() const

If C is a constant integer then return its value, otherwise C must be a vector of constant integers,...

LLVM_ABI bool containsConstantExpression() const

Return true if this is a fixed width vector constant that includes any constant expressions.

LLVM_ABI bool isFiniteNonZeroFP() const

Return true if this is a finite and non-zero floating-point scalar constant or a fixed width vector c...

LLVM_ABI void removeDeadConstantUsers() const

If there are any dead constant users dangling off of this constant, remove them.

LLVM_ABI bool isNormalFP() const

Return true if this is a normal (as opposed to denormal, infinity, nan, or zero) floating-point scala...

LLVM_ABI bool needsDynamicRelocation() const

static LLVM_ABI Constant * getNullValue(Type *Ty)

Constructor to create a '0' constant of arbitrary type.

LLVM_ABI bool isNaN() const

Return true if this is a floating-point NaN constant or a vector floating-point constant with all NaN...

LLVM_ABI bool isMinSignedValue() const

Return true if the value is the smallest signed value.

LLVM_ABI bool isConstantUsed() const

Return true if the constant has users other than constant expressions and other dangling things.

LLVM_ABI Constant * getAggregateElement(unsigned Elt) const

For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...

LLVM_ABI bool isThreadDependent() const

Return true if the value can vary between threads.

LLVM_ABI bool isZeroValue() const

Return true if the value is negative zero or null value.

LLVM_ABI void destroyConstant()

Called if some element of this constant is no longer valid.

LLVM_ABI bool isNotMinSignedValue() const

Return true if the value is not the smallest signed value, or, for vectors, does not contain smallest...

LLVM_ABI bool isNullValue() const

Return true if this is the value that would be returned by getNullValue.

static bool classof(const Value *V)

Definition Constant.h:176

LLVM_ABI bool isNotOneValue() const

Return true if the value is not the one value, or, for vectors, does not contain one value elements.

LLVM_ABI bool isElementWiseEqual(Value *Y) const

Return true if this constant and a constant 'Y' are element-wise equal.

LLVM_ABI bool containsUndefOrPoisonElement() const

Return true if this is a vector constant that includes any undef or poison elements.

LLVM_ABI bool containsPoisonElement() const

Return true if this is a vector constant that includes any poison elements.

LLVM_ABI void handleOperandChange(Value *, Value *)

This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does...

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

User(Type *ty, unsigned vty, AllocInfo AllocInfo)

LLVM Value Representation.

LLVM_ABI const Value * stripPointerCasts() const

Strip off pointer casts, all-zero GEPs and address space casts.

ValueTy

Concrete subclass of this.

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

Information about how a User object was allocated, to be passed into the User constructor.