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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16#ifndef LLVM_IR_USE_H

17#define LLVM_IR_USE_H

18

22

23namespace llvm {

24

28

29

30

31

32

33

34

36public:

38

39

40

42

43private:

44

45 ~Use() { removeFromList(); }

46

47

48 Use(User *Parent) : Parent(Parent) {}

49

50public:

53

54 operator Value *() const { return Val; }

56

57

58

59

60

62

64

67

70

72

73

75

76

77

78 LLVM_ABI static void zap(Use *Start, const Use *Stop, bool del = false);

79

80private:

81

82 Value *Val = nullptr;

84 Use **Prev = nullptr;

85 User *Parent = nullptr;

86

87 void addToList(Use **List) {

92 *Prev = this;

93 }

94

95 void removeFromList() {

96 if (Prev) {

99 Next->Prev = Prev;

100 Next = nullptr;

101 }

102

103 Prev = nullptr;

104 }

105 }

106};

107

108

109

120

121

123

124}

125

126#endif

#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)

A Use represents the edge between a Value definition and its users.

Definition Use.h:35

LLVM_ABI unsigned getOperandNo() const

Return the operand # of this use in its User.

friend class User

Definition Use.h:52

const Value * operator->() const

Definition Use.h:69

LLVM_ABI void set(Value *Val)

User * getUser() const

Returns the User that contains this Use.

Definition Use.h:61

Value * operator->()

Definition Use.h:68

static LLVM_ABI void zap(Use *Start, const Use *Stop, bool del=false)

Destroys Use operands when the number of operands of a User changes.

Use * getNext() const

Definition Use.h:71

Value * get() const

Definition Use.h:55

LLVM_ABI Value * operator=(Value *RHS)

LLVM_ABI void swap(Use &RHS)

Provide a fast substitute to std::swap that also works with less standard-compliant compilers.

friend class Value

Definition Use.h:51

LLVM Value Representation.

struct LLVMOpaqueUse * LLVMUseRef

Used to get the users and usees of a Value.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr Next

static SimpleType getSimplifiedValue(Use &Val)

Definition Use.h:113

Value * SimpleType

Definition Use.h:111

Value * SimpleType

Definition Use.h:116

static SimpleType getSimplifiedValue(const Use &Val)

Definition Use.h:118

Define a template that can be specialized by smart pointers to reflect the fact that they are automat...