LLVM 22.0.0git
Public Types | Public Member Functions | List of all members
llvm::MutableArrayRef< T > Class Template Reference

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memory), i.e. More...

#include "llvm/ADT/ArrayRef.h"

Inheritance diagram for llvm::MutableArrayRef< T >:
[フレーム]
[legend]

Public Types

using  value_type = T
using  pointer = value_type *
using  reference = value_type &
using  iterator = pointer
using  reverse_iterator = std::reverse_iterator<iterator>
using  const_reverse_iterator = std::reverse_iterator<const_iterator>
using  size_type = size_t
Public Types inherited from llvm::ArrayRef< T >
using  value_type = T
using  pointer = value_type *
using  reference = value_type &
using  reverse_iterator = std::reverse_iterator<iterator>
using  const_reverse_iterator = std::reverse_iterator<const_iterator>
using  size_type = size_t

Public Member Functions

  MutableArrayRef ()=default
  Construct an empty MutableArrayRef.
  MutableArrayRef (T &OneElt)
  Construct a MutableArrayRef from a single element.
  MutableArrayRef (T *data, size_t length)
  Construct a MutableArrayRef from a pointer and length.
  Construct a MutableArrayRef from a range.
template<typename C, typename = std::enable_if_t< std::conjunction_v< std::is_convertible< decltype(std::declval<C &>().data()) *, T *const *>, std::is_integral<decltype(std::declval<C &>().size())>>
constexpr  MutableArrayRef (const C &V)
  Construct a MutableArrayRef from a type that has a data() method that returns a pointer convertible to T *.
template<size_t N>
constexpr  MutableArrayRef (T(&Arr)[N])
  Construct a MutableArrayRef from a C array.
Tdata () const
Tfront () const
  front - Get the first element.
Tback () const
  back - Get the last element.
  consume_front() - Returns the first element and drops it from ArrayRef.
Tconsume_back ()
  consume_back() - Returns the last element and drops it from ArrayRef.
MutableArrayRef< Tslice (size_t N, size_t M) const
  slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
MutableArrayRef< Tslice (size_t N) const
  slice(n) - Chop off the first N elements of the array.
MutableArrayRef< Tdrop_front (size_t N=1) const
  Drop the first N elements of the array.
MutableArrayRef< Tdrop_back (size_t N=1) const
template<class PredicateT>
  Return a copy of *this with the first N elements satisfying the given predicate removed.
template<class PredicateT>
  Return a copy of *this with the first N elements not satisfying the given predicate removed.
MutableArrayRef< Ttake_front (size_t N=1) const
  Return a copy of *this with only the first N elements.
MutableArrayRef< Ttake_back (size_t N=1) const
  Return a copy of *this with only the last N elements.
template<class PredicateT>
  Return the first N elements of this Array that satisfy the given predicate.
template<class PredicateT>
  Return the first N elements of this Array that don't satisfy the given predicate.
Operator Overloads
Toperator[] (size_t Index) const
Public Member Functions inherited from llvm::ArrayRef< T >
  ArrayRef ()=default
  Construct an empty ArrayRef.
  Construct an ArrayRef from a single element.
constexpr  ArrayRef (const T *data LLVM_LIFETIME_BOUND, size_t length)
  Construct an ArrayRef from a pointer and length.
  Construct an ArrayRef from a range.
template<typename C, typename = std::enable_if_t< std::conjunction_v< std::is_convertible< decltype(std::declval<const C &>().data()) *, const T *const *>, std::is_integral<decltype(std::declval<const C &>().size())>>
constexpr  ArrayRef (const C &V)
  Construct an ArrayRef from a type that has a data() method that returns a pointer convertible to const T *.
template<size_t N>
constexpr  ArrayRef (const T(&Arr LLVM_LIFETIME_BOUND)[N])
  Construct an ArrayRef from a C array.
constexpr  ArrayRef (std::initializer_list< T > Vec LLVM_LIFETIME_BOUND)
  Construct an ArrayRef from a std::initializer_list.
template<typename U, typename = std::enable_if_t< std::is_convertible_v<U *const *, T *const *>>>
  Construct an ArrayRef<T> from iterator_range<U*>.
  empty - Check if the array is empty.
const Tdata () const
size_t  size () const
  size - Get the array size.
const Tfront () const
  front - Get the first element.
const Tback () const
  back - Get the last element.
  consume_front() - Returns the first element and drops it from ArrayRef.
  consume_back() - Returns the last element and drops it from ArrayRef.
template<typename Allocator>
  equals - Check for element-wise equality.
ArrayRef< Tslice (size_t N, size_t M) const
  slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
ArrayRef< Tslice (size_t N) const
  slice(n) - Chop off the first N elements of the array.
ArrayRef< Tdrop_front (size_t N=1) const
  Drop the first N elements of the array.
ArrayRef< Tdrop_back (size_t N=1) const
  Drop the last N elements of the array.
template<class PredicateT>
  Return a copy of *this with the first N elements satisfying the given predicate removed.
template<class PredicateT>
  Return a copy of *this with the first N elements not satisfying the given predicate removed.
ArrayRef< Ttake_front (size_t N=1) const
  Return a copy of *this with only the first N elements.
ArrayRef< Ttake_back (size_t N=1) const
  Return a copy of *this with only the last N elements.
template<class PredicateT>
  Return the first N elements of this Array that satisfy the given predicate.
template<class PredicateT>
  Return the first N elements of this Array that don't satisfy the given predicate.
const Toperator[] (size_t Index) const
template<typename U>
std::enable_if_t< std::is_same< U, T >::value, ArrayRef< T > > &  operator= (U &&Temporary)=delete
  Disallow accidental assignment from a temporary.
template<typename U>
std::enable_if_t< std::is_same< U, T >::value, ArrayRef< T > > &  operator= (std::initializer_list< U >)=delete
  Disallow accidental assignment from a temporary.
std::vector< Tvec () const

Detailed Description

template<typename T>
class llvm::MutableArrayRef< T >

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memory), i.e.

a start pointer and a length. It allows various APIs to take and modify consecutive elements easily and conveniently.

This class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer, whose lifetime extends past that of the MutableArrayRef. For this reason, it is not in general safe to store a MutableArrayRef.

This is intended to be trivially copyable, so it should be passed by value.

Definition at line 299 of file ArrayRef.h.

Member Typedef Documentation

◆  const_iterator

template<typename T>

Definition at line 307 of file ArrayRef.h.

◆  const_pointer

template<typename T>
using llvm::MutableArrayRef< T >::const_pointer = const value_type *

Definition at line 303 of file ArrayRef.h.

◆  const_reference

template<typename T>
using llvm::MutableArrayRef< T >::const_reference = const value_type &

Definition at line 305 of file ArrayRef.h.

◆  const_reverse_iterator

template<typename T>
using llvm::MutableArrayRef< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 309 of file ArrayRef.h.

◆  difference_type

template<typename T>
using llvm::MutableArrayRef< T >::difference_type = ptrdiff_t

Definition at line 311 of file ArrayRef.h.

◆  iterator

template<typename T>
using llvm::MutableArrayRef< T >::iterator = pointer

Definition at line 306 of file ArrayRef.h.

◆  pointer

template<typename T>
using llvm::MutableArrayRef< T >::pointer = value_type *

Definition at line 302 of file ArrayRef.h.

◆  reference

template<typename T>
using llvm::MutableArrayRef< T >::reference = value_type &

Definition at line 304 of file ArrayRef.h.

◆  reverse_iterator

template<typename T>
using llvm::MutableArrayRef< T >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 308 of file ArrayRef.h.

◆  size_type

template<typename T>
using llvm::MutableArrayRef< T >::size_type = size_t

Definition at line 310 of file ArrayRef.h.

◆  value_type

template<typename T>
using llvm::MutableArrayRef< T >::value_type = T

Definition at line 301 of file ArrayRef.h.

Constructor & Destructor Documentation

◆  MutableArrayRef() [1/6]

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( )
default

Construct an empty MutableArrayRef.

Referenced by llvm::OwningArrayRef< T >::OwningArrayRef(), and llvm::OwningArrayRef< T >::OwningArrayRef().

◆  MutableArrayRef() [2/6]

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T & OneElt )
inline

Construct a MutableArrayRef from a single element.

Definition at line 317 of file ArrayRef.h.

◆  MutableArrayRef() [3/6]

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T * data,
size_t length )
inline

Construct a MutableArrayRef from a pointer and length.

Definition at line 320 of file ArrayRef.h.

◆  MutableArrayRef() [4/6]

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T * begin,
T * end )
inline

Construct a MutableArrayRef from a range.

Definition at line 324 of file ArrayRef.h.

◆  MutableArrayRef() [5/6]

template<typename T>
template<typename C, typename = std::enable_if_t< std::conjunction_v< std::is_convertible< decltype(std::declval<C &>().data()) *, T *const *>, std::is_integral<decltype(std::declval<C &>().size())>>
llvm::MutableArrayRef< T >::MutableArrayRef ( const C & V )
inlineconstexpr

Construct a MutableArrayRef from a type that has a data() method that returns a pointer convertible to T *.

Definition at line 335 of file ArrayRef.h.

◆  MutableArrayRef() [6/6]

template<typename T>
template<size_t N>
llvm::MutableArrayRef< T >::MutableArrayRef ( T(&) Arr[N] )
inlineconstexpr

Construct a MutableArrayRef from a C array.

Definition at line 339 of file ArrayRef.h.

Member Function Documentation

◆  back()

template<typename T>
T & llvm::MutableArrayRef< T >::back ( ) const
inline

back - Get the last element.

Definition at line 356 of file ArrayRef.h.

Referenced by llvm::performOptimizedStructLayout().

◆  begin()

template<typename T>
iterator llvm::MutableArrayRef< T >::begin ( ) const
inline

Definition at line 343 of file ArrayRef.h.

Referenced by combineConcatVectorOfShuffleAndItsOperands(), llvm::lto::findThinLTOModule(), llvm::performOptimizedStructLayout(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), toUTF8(), and turnVectorIntoSplatVector().

◆  consume_back()

template<typename T>
T & llvm::MutableArrayRef< T >::consume_back ( )
inline

consume_back() - Returns the last element and drops it from ArrayRef.

Definition at line 369 of file ArrayRef.h.

◆  consume_front()

template<typename T>
T & llvm::MutableArrayRef< T >::consume_front ( )
inline

consume_front() - Returns the first element and drops it from ArrayRef.

Definition at line 362 of file ArrayRef.h.

◆  data()

template<typename T>
T * llvm::MutableArrayRef< T >::data ( ) const
inline

Definition at line 341 of file ArrayRef.h.

Referenced by llvm::detail::IEEEFloat::convertToInteger(), llvm::jitlink::LinkGraph::createMutableContentBlock(), llvm::object::Decompressor::decompress(), llvm::jitlink::finalizeBlockRelax(), llvm::pdb::TpiStreamBuilder::finalizeMsfLayout(), getOpenFileImpl(), llvm::performOptimizedStructLayout(), llvm::cas::ondisk::OnDiskKeyValueDB::put(), llvm::jitlink::Block::setMutableContent(), llvm::MCDecodedPseudoProbeInlineTree::setProbes(), llvm::orc::MachOBuilderDylibLoadCommand< LCType >::write(), llvm::orc::MachOBuilderLoadCommand< MachO::LC_RPATH >::write(), and llvm::MachObjectWriter::writeObject().

◆  drop_back()

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::drop_back ( size_t N = 1 ) const
inline

Definition at line 393 of file ArrayRef.h.

◆  drop_front()

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::drop_front ( size_t N = 1 ) const
inline

Drop the first N elements of the array.

Definition at line 388 of file ArrayRef.h.

Referenced by llvm::AMDGPULegalizerInfo::buildMultiply(), and getOpenFileImpl().

◆  drop_until()

template<typename T>
template<class PredicateT>
MutableArrayRef< T > llvm::MutableArrayRef< T >::drop_until ( PredicateT Pred ) const
inline

Return a copy of *this with the first N elements not satisfying the given predicate removed.

Definition at line 408 of file ArrayRef.h.

◆  drop_while()

template<typename T>
template<class PredicateT>
MutableArrayRef< T > llvm::MutableArrayRef< T >::drop_while ( PredicateT Pred ) const
inline

Return a copy of *this with the first N elements satisfying the given predicate removed.

Definition at line 401 of file ArrayRef.h.

◆  end()

template<typename T>
iterator llvm::MutableArrayRef< T >::end ( ) const
inline

Definition at line 344 of file ArrayRef.h.

Referenced by combineConcatVectorOfShuffleAndItsOperands(), llvm::performOptimizedStructLayout(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), toUTF8(), and turnVectorIntoSplatVector().

◆  front()

template<typename T>
T & llvm::MutableArrayRef< T >::front ( ) const
inline

front - Get the first element.

Definition at line 350 of file ArrayRef.h.

◆  operator[]()

template<typename T>
T & llvm::MutableArrayRef< T >::operator[] ( size_t Index ) const
inline

Definition at line 443 of file ArrayRef.h.

◆  rbegin()

template<typename T>
inline

Definition at line 346 of file ArrayRef.h.

◆  rend()

template<typename T>
inline

Definition at line 347 of file ArrayRef.h.

◆  slice() [1/2]

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::slice ( size_t N ) const
inline

slice(n) - Chop off the first N elements of the array.

Definition at line 383 of file ArrayRef.h.

◆  slice() [2/2]

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::slice ( size_t N,
size_t M ) const
inline

slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.

Definition at line 377 of file ArrayRef.h.

Referenced by llvm::MCFragment::getFixups(), llvm::MCFragment::getVarContents(), llvm::MCFragment::getVarContents(), llvm::MCFragment::getVarFixups(), llvm::insertMultibyteShift(), and multikeySort().

◆  take_back()

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::take_back ( size_t N = 1 ) const
inline

Return a copy of *this with only the last N elements.

Definition at line 420 of file ArrayRef.h.

Referenced by combineConcatVectorOfShuffleAndItsOperands().

◆  take_front()

template<typename T>
MutableArrayRef< T > llvm::MutableArrayRef< T >::take_front ( size_t N = 1 ) const
inline

Return a copy of *this with only the first N elements.

Definition at line 413 of file ArrayRef.h.

Referenced by combineConcatVectorOfShuffleAndItsOperands().

◆  take_until()

template<typename T>
template<class PredicateT>
MutableArrayRef< T > llvm::MutableArrayRef< T >::take_until ( PredicateT Pred ) const
inline

Return the first N elements of this Array that don't satisfy the given predicate.

Definition at line 436 of file ArrayRef.h.

◆  take_while()

template<typename T>
template<class PredicateT>
MutableArrayRef< T > llvm::MutableArrayRef< T >::take_while ( PredicateT Pred ) const
inline

Return the first N elements of this Array that satisfy the given predicate.

Definition at line 429 of file ArrayRef.h.


The documentation for this class was generated from the following file:

Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /