9#ifndef LLVM_ADT_TINYPTRVECTOR_H
10#define LLVM_ADT_TINYPTRVECTOR_H
41 static constexpr VecTy *EmptyVal =
nullptr;
44 bool isSingleElementForm()
const {
return isa<EltTy>(Val); }
73 if (!isMultiElementForm()) {
82 if (
RHS.isSingleElementForm()) {
107 V->push_back(
RHS.front());
142 if (isSingleElementForm())
150 if (isSingleElementForm())
163 if (isSingleElementForm())
164 return Val.getAddrOfPtr1();
170 return reinterpret_cast<EltTy *
>(
this);
177 if (isSingleElementForm())
210 if (isSingleElementForm()) {
211 assert(i == 0 &&
"tinyvector index out of range");
221 if (isSingleElementForm())
228 if (isSingleElementForm())
241 if (isSingleElementForm()) {
243 Val =
new VecTy({
V, NewVal});
254 if (isSingleElementForm())
262 if (isSingleElementForm()) {
271 assert(
I >=
begin() &&
"Iterator to erase is out of bounds.");
272 assert(
I <
end() &&
"Erasing at past-the-end iterator.");
275 if (isSingleElementForm()) {
287 assert(S >=
begin() &&
"Range to erase is out of bounds.");
288 assert(S <=
E &&
"Trying to erase invalid range.");
289 assert(
E <=
end() &&
"Trying to erase past the end.");
291 if (isSingleElementForm()) {
292 if (S ==
begin() && S !=
E)
294 }
else if (isMultiElementForm()) {
301 assert(
I >= this->
begin() &&
"Insertion iterator is out of bounds.");
305 return std::prev(
end());
307 if (isSingleElementForm()) {
318 template<
typename ItTy>
320 assert(
I >= this->
begin() &&
"Insertion iterator is out of bounds.");
327 if (std::next(From) == To) {
333 }
else if (isSingleElementForm()) {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ATTRIBUTE_WARN_UNUSED
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
This file defines the PointerUnion class, which is a discriminated union of pointer types.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
A discriminated union of two or more pointer types, with the discriminator in the low bits of the poi...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
reverse_iterator rbegin()
const EltTy * const_iterator
TinyPtrVector(std::initializer_list< EltTy > IL)
void push_back(EltTy NewVal)
TinyPtrVector & operator=(TinyPtrVector &&RHS)
std::reverse_iterator< const_iterator > const_reverse_iterator
const_reverse_iterator rbegin() const
TinyPtrVector(ArrayRef< EltTy > Elts)
Constructor from an ArrayRef.
std::reverse_iterator< iterator > reverse_iterator
const_iterator begin() const
iterator erase(iterator I)
TinyPtrVector & operator=(const TinyPtrVector &RHS)
TinyPtrVector(const TinyPtrVector &RHS)
const_reverse_iterator rend() const
const EltTy * data() const
const_iterator end() const
PointerUnion< EltTy, VecTy * > PtrUnion
iterator insert(iterator I, const EltTy &Elt)
iterator erase(iterator S, iterator E)
SmallVector< EltTy, 4 > VecTy
typename VecTy::value_type value_type
TinyPtrVector(TinyPtrVector &&RHS)
iterator insert(iterator I, ItTy From, ItTy To)
EltTy operator[](unsigned i) const
TinyPtrVector(size_t Count, EltTy Value)
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.