10 #ifndef LLVM_ADT_UNIQUEVECTOR_H 11 #define LLVM_ADT_UNIQUEVECTOR_H 28 using iterator =
typename VectorType::iterator;
33 std::map<T, unsigned> Map;
43 unsigned &Val = Map[Entry];
49 Val =
static_cast<unsigned>(Vector.size()) + 1;
52 Vector.push_back(Entry);
58 unsigned idFor(
const T &Entry)
const {
60 typename std::map<T, unsigned>::const_iterator
MI = Map.find(Entry);
63 if (MI != Map.end())
return MI->second;
71 assert(ID-1 <
size() &&
"ID is 0 or out of range!");
72 return Vector[ID - 1];
88 size_t size()
const {
return Vector.size(); }
91 bool empty()
const {
return Vector.empty(); }
102 #endif // LLVM_ADT_UNIQUEVECTOR_H This class represents lattice values for constants.
typename std::vector< std::string > VectorType
const T & operator[](unsigned ID) const
operator[] - Returns a reference to the entry with the specified ID.
bool empty() const
empty - Returns true if the vector is empty.
unsigned idFor(const T &Entry) const
idFor - return the ID for an existing entry.
const_iterator end() const
Return an iterator to the end of the vector.
typename VectorType::const_iterator const_iterator
typename VectorType::iterator iterator
void reset()
reset - Clears all the entries.
iterator begin()
Return an iterator to the start of the vector.
size_t size() const
size - Returns the number of entries in the vector.
const_iterator begin() const
Return an iterator to the start of the vector.
iterator end()
Return an iterator to the end of the vector.
unsigned insert(const T &Entry)
insert - Append entry to the vector if it doesn't already exist.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
UniqueVector - This class produces a sequential ID number (base 1) for each unique entry that is adde...