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

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_IR_VALUESYMBOLTABLE_H

14#define LLVM_IR_VALUESYMBOLTABLE_H

15

20#include

21

22namespace llvm {

23

33template class SmallString;

35

36

37

38

39

50

51

52

53public:

54

56

57

59

60

62

63

64

65

66

67 ValueSymbolTable(int MaxNameSize = -1) : vmap(0), MaxNameSize(MaxNameSize) {}

69

70

71

72

73

74

75

76

77

79 if (MaxNameSize > -1 && Name.size() > (unsigned)MaxNameSize)

80 Name = Name.substr(0, std::max(1u, (unsigned)MaxNameSize));

81

82 return vmap.lookup(Name);

83 }

84

85

86

87 inline bool empty() const { return vmap.empty(); }

88

89

90 inline unsigned size() const { return unsigned(vmap.size()); }

91

92

93

94

96

97

98

99

100

101

103

104

106

107

109

110

112

113

114

115

116private:

118

119

120

121

122

123 void reinsertValue(Value *V);

124

125

126

127

129

130

131

132

133 void removeValueName(ValueName *V);

134

135

136

137

138

139 ValueMap vmap;

140 int MaxNameSize;

141

142 mutable uint32_t LastUnique = 0;

143

144

145};

146

147}

148

149#endif

This file defines the StringMap class.

This class represents an incoming formal argument to a Function.

LLVM Basic Block Representation.

SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...

StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...

StringMapIterBase< Value *, false > iterator

StringMapIterBase< Value *, true > const_iterator

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

bool empty() const

Definition ValueSymbolTable.h:87

ValueSymbolTable(int MaxNameSize=-1)

Definition ValueSymbolTable.h:67

LLVM_ABI void dump() const

This function can be used from the debugger to display the content of the symbol table while debuggin...

const_iterator begin() const

Get a const_iterator that from the beginning of the symbol table.

Definition ValueSymbolTable.h:105

Value * lookup(StringRef Name) const

This method finds the value with the given Name in the the symbol table.

Definition ValueSymbolTable.h:78

ValueMap::const_iterator const_iterator

A const_iterator over a ValueMap.

Definition ValueSymbolTable.h:61

const_iterator end() const

Get a const_iterator to the end of the symbol table.

Definition ValueSymbolTable.h:111

iterator end()

Get an iterator to the end of the symbol table.

Definition ValueSymbolTable.h:108

LLVM_ABI ~ValueSymbolTable()

StringMap< Value * > ValueMap

A mapping of names to values.

Definition ValueSymbolTable.h:55

friend class Value

Definition ValueSymbolTable.h:49

unsigned size() const

The number of name/type pairs is returned.

Definition ValueSymbolTable.h:90

iterator begin()

Get an iterator that from the beginning of the symbol table.

Definition ValueSymbolTable.h:102

ValueMap::iterator iterator

An iterator over a ValueMap.

Definition ValueSymbolTable.h:58

LLVM Value Representation.

This is an optimization pass for GlobalISel generic memory operations.

StringMapEntry< Value * > ValueName

Option to add extra bits to the ilist_iterator.

Option to add a pointer to this list's owner in every node.