A constant reference to consecutive elements in memory.
Synopsis
Declared in <llvm/ADT/ArrayRef.h>
template<typename T>
class [[nodiscard]] ArrayRef;
Description
Represents a constant 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 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 ArrayRef. For this reason, it is not in general safe to store an ArrayRef.
This is intended to be trivially copyable, so it should be passed by value.
Type Aliases
Name |
Description |
Const iterator over the referenced array elements. |
|
Pointer to a const element. |
|
Const reference to an element. |
|
Const reverse iterator over the referenced array elements. |
|
Signed type used to express distances between iterators. |
|
Iterator over the referenced array elements. |
|
Mutable pointer to an element. |
|
Mutable reference to an element. |
|
Reverse iterator over the referenced array elements. |
|
Unsigned type used to express the size of the array. |
|
Element type stored in the referenced array. |
Member Functions
Name |
Description |
|
Constructors |
Disallow accidental assignment from a temporary. |
|
Get the last element. |
|
Return an iterator to the first element. |
|
consume_back() ‐ Returns the last element and drops it from ArrayRef. |
|
consume_front() ‐ Returns the first element and drops it from ArrayRef. |
|
Allocate a mutable copy in |
|
Return a pointer to the first element of the array. |
|
Drop the last |
|
Drop the first |
|
Return a copy of *this with the first N elements not satisfying the given predicate removed. |
|
Return a copy of *this with the first N elements satisfying the given predicate removed. |
|
Check if the array is empty. |
|
Return an iterator past the last element. |
|
Check for element‐wise equality. |
|
Get the first element. |
|
Return a const reference to the element at |
|
Return a reverse iterator to the last element. |
|
Return a reverse iterator to the element before the first element. |
|
Get the array size. |
|
|
|
Return a copy of *this with only the last |
|
Return a copy of *this with only the first |
|
Return the first N elements of this Array that don't satisfy the given predicate. |
|
Return the first N elements of this Array that satisfy the given predicate. |
|
Copy the referenced elements into a new std::vector. |
|
Convert this ArrayRef into a std::vector copy of its elements. |
Deduction Guides
Name |
Description |
Deduction guide to construct an ArrayRef from an ArrayRef |
|
@{ Deduction guide to construct an ArrayRef from a single element. |
|
Deduction guide to construct an ArrayRef from an ArrayRef (const) |
|
Deduction guide to construct an ArrayRef from a SmallVector |
|
Deduction guide to construct an ArrayRef from a std::vector |
|
Deduction guide to construct an ArrayRef from a SmallVector |
|
Deduction guide to construct an ArrayRef from a std::array |
|
Deduction guide to construct an ArrayRef from a C array. |
|
Deduction guide to construct an ArrayRef from a pointer and length |
|
Deduction guide to construct an ArrayRef from a range |
Non-Member Functions
Name |
Description |
Determine the edit distance between two sequences. |
|
Determine the edit distance between two sequences. |
|
Find in type conversion cost table. |
|
Find in cost table. |
|
Delete the specified blocks, which must have no live predecessors. |
|
Print an error diagnostic at source location(s) |
|
Print an error at |
|
Print a note at |
|
Print a note diagnostic at source location(s) |
|
Print a warning diagnostic at source location(s) |
|
Promote the specified list of alloca instructions into scalar registers, inserting PHI nodes as appropriate. |
|
Compare two option prefix sequences for sorting. |
|
Construct an array ref of bytes from a string ref. |
|
Check if values in |
|
Removes the temporary files named in |
|
Clone noalias scopes and adapt instructions in a range. |
|
Clone noalias scopes and adapt instructions in new blocks. |
|
Duplicate the listed noalias declaration scopes. |
|
Serialize global‐object name strings into a profile‐ready blob. |
|
Serialize referenced PGO function‐name variables into |
|
Serialize vtable name strings into a profile‐ready blob. |
|
Compute a saturated expression‐size estimate from operand sizes. |
|
Compute a map of integer instructions to their minimum legal type size. |
|
Converts a UTF16 string into a UTF8 std::string. |
|
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string. |
|
Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string. |
|
Converts a UTF32 string into a UTF8 std::string. |
|
Replace constant expressions users of the given constants with instructions. |
|
Compute the CRC‐32 of |
|
Create a DAG mutation that fuses instruction pairs matching the given predicates. |
|
Insert LCSSA PHI nodes required after splitting a loop exit edge. |
|
Create a unary shuffle mask from a binary shuffle mask. |
|
Replace every block in |
|
Entry point for the dlltool.exe‐compatible driver used by llvm‐dlltool. |
|
downscale the given weights preserving the ratio. If the maximum value is not already known and not provided via |
|
Convert `Bytes' to a hex string and output to `OS' |
|
Dump non‐zero entries of |
|
Erase a list of dead instructions, optionally notifying a debug observer. |
|
Push the weights right to fit in uint32_t. |
|
Format |
|
Format |
|
Convenience function for recomputing live‐in's for a set of MBBs until the computation converges. |
|
Returns the types contained in |
|
Repetitively apply |
|
Computes a SipHash‐2‐4 128‐bit result. |
|
Computes a SipHash‐2‐4 64‐bit result. |
|
Return the common non‐negative splat index in |
|
Returns true if a blob of text starts with a UTF‐16 big or little endian byte order mark. |
|
Compute a hash_code for an ArrayRef. |
|
Collect noalias scopes declared in the given basic blocks. |
|
Return true if |
|
Entry point for the lib.exe‐compatible driver used by llvm‐lib and lld‐link /lib. |
|
Return true if |
|
Lexicographically compare two `ArrayRef`s. |
|
Return true if |
|
Return true if |
|
Lexicographically compare two `ArrayRef`s. |
|
Return true if |
|
Split and process a shuffle mask across real input and output registers. |
|
Decode a wide APInt from a sequence of 64‐bit words. |
|
Remaps instructions in |
|
Attempt to sort the pointers in |
|
Combine the hashes in |
|
Convert buffer |
|
Convert the bytes in |
|
Construct a string ref from an array ref of unsigned chars. |
|
Construct a string ref from an array ref of chars. |
|
Widen a shuffle mask with Scale=2, treating ‐1 as undef. |
|
Write an archive into a memory buffer. |
|
Compute the XXH3 128‐bit hash of the bytes in |
|
Compute the XXH3 64‐bit hash of the bytes in |
|
Compute the CPU‐supports bitmask for the given FMV feature names. |
|
Compute the FMV priority bitmask for the given feature names. |
|
Encodes the BBAddrMap payload into a contiguous blob. |
|
Parse a |
|
Parse a |
|
Parse a |
|
Populate string and checksum tables from YAML debug subsections. |
|
Serialize a YAML |
|
Serialize YAML leaf records into a |
|
Return whether SHT_NOBITS section |
|
Check if a value is contained in any of the intervals. |
|
|
Merge adjacent/consecutive intervals into single intervals. Example: [1‐3, 4‐6, 8‐10]‐> [1‐6, 8‐10]. |
Fill the IIT table descriptors for an intrinsic into |
|
Map a list of targets to the set of architectures. |
|
Map a list of targets to the set of platforms. |
|
Map a list of target triples to the set of platforms they represent. |
|
Map a list of targets to the set of platform and version pairs. |
|
Match shuffle mask |
|
Parse a V3 UNWIND_INFO from raw bytes. Returns an error on malformed data. |
|
Decode one WOD from the pool at the given byte offset. Returns an error on malformed data. |
|
Build the 128‐bit feature mask for |
|
Simplify a sequence of CFG edge updates by removing redundancy and cancels. |
|
Merge the codegen data from the scratch objects from the first codegen round. |
|
Mark all options not part of the categories as cl::ReallyHidden. |
|
Return enabled LLVM build‐configuration tags such as |
|
Build a |
|
Estimate the quality of a given node order in a CFG. |
|
Estimate the quality of the current node order in a CFG. |
|
Apply a Cache‐Directed Sort to a call graph of functions. |
|
Find a CFG node layout that optimizes jump locality. |
|
Discover TypeIndex references in raw type‐record bytes. |
|
Collect every TypeIndex referenced by raw type‐record bytes. |
|
Discover TypeIndex references in raw symbol‐record bytes. |
|
Collect every TypeIndex referenced by raw symbol‐record bytes. |
|
Adapt a GUID byte sequence for use with formatv. |
|
Invoke |
|
Reinterpret a byte array as a null‐terminated C string. |
|
Reinterpret a byte array as an array of characters. Does not interpret as a C string, as StringRef has several helpers (split) that make that easy. |
|
Build an array serialization helper whose length comes from |
|
Build a helper that deserializes the remaining stream as an array of |
|
Visit every member record in a field‐list byte stream. |
|
Take an optional DWARFFormValue and try to extract block data. |
|
Fills in Symtab and StrtabBuilder with a valid symbol and string table for Mods. |
|
Produces a container ordering for optimal multi‐threaded processing. |
|
Build callstack metadata from the provided list of call stack ids. |
|
Generate a single hash id for a given callstack. |
|
Decode a CREL relocation blob, invoking handlers for the header and entries. |
|
True when |
|
Write a Mach‐O universal binary containing |
|
Write a Mach‐O universal binary containing |
|
Return the compound directive formed by |
|
Return the leaf constructs that make up compound directive |
|
Return the leaf constructs of |
|
Append the leaf and composite constituents of |
|
Return the OpenMP language versions supported by this frontend. |
|
Return the reserved OpenMP locator names (lowercase). |
|
Convenience function for creating a search order from an ArrayRef of JITDylib*, all with the same flags. |
|
Compute the PDB V8 buffer hash (CRC‐32) of raw bytes. |
|
Join strings into lines of at most |
|
Find the lowest offset at which a value of |
|
Compress |
|
Decompress zlib‐compressed |
|
Decompress zlib‐compressed |
|
Compress |
|
Decompress zstd‐compressed |
|
Decompress zstd‐compressed |
|
|
Return null‐pointer bytes sized for a GOT entry in |
|
Return the pointer‐jump stub content for the architecture of |
|
Return the content used to initialize a GOT entry block. |
|
Return the instruction bytes for a pointer jump stub block. |
Serialize |
|
Run deallocation actions. Dealloc actions will be run in reverse order (from last element of DAs to first). |
Derived Classes
Name |
Description |
A mutable reference to consecutive elements in memory. |
Return Value
|
Note
|
The return value should not be discarded. |
Template Parameters
Name |
Description |
T |
Element type of the referenced array. |
Created with MrDocs