20#ifndef LLVM_ADT_INDEXEDMAP_H
21#define LLVM_ADT_INDEXEDMAP_H
30template <
typename T,
typename ToIndexT =
identity<
unsigned>>
class IndexedMap {
31 using IndexT =
typename ToIndexT::argument_type;
47 assert(toIndex_(n) < storage_.size() &&
"index out of bounds!");
48 return storage_[toIndex_(n)];
52 assert(toIndex_(n) < storage_.size() &&
"index out of bounds!");
53 return storage_[toIndex_(n)];
60 void clear() { storage_.clear(); }
63 unsigned NewSize = toIndex_(n) + 1;
64 if (NewSize > storage_.size())
68 bool inBounds(IndexT n)
const {
return toIndex_(n) < storage_.size(); }
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
StorageT::size_type size() const
void resize(typename StorageT::size_type s)
StorageT::reference operator[](IndexT n)
void reserve(typename StorageT::size_type s)
StorageT::const_reference operator[](IndexT n) const
bool inBounds(IndexT n) const
const T & const_reference
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.