llvm::SmallVectorImpl

This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.

Synopsis

Declared in <llvm/ADT/SmallVector.h>

template<typename T>
class SmallVectorImpl
    : public SmallVectorTemplateBase<T>

Base Classes

NameDescription
SmallVectorTemplateBase<T>SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T's.

Type Aliases

NameDescription
const_iterator Const iterator over the vector elements.
const_pointer Const pointer to an element.
const_reference Const reference to an element.
const_reverse_iterator Const reverse iterator over the vector elements.
difference_type Signed type used to express the distance between iterators.
iterator Mutable iterator over the vector elements.
pointer Mutable pointer to an element.
reference Mutable reference to an element.
reverse_iterator Reverse iterator over the vector elements.
size_type Unsigned type used to express the size of the vector.
value_type Element type stored in the vector.

Member Functions

NameDescription
SmallVectorImpl [constructor] [deleted]Copy construction is not allowed.
operator= Assignment operators
append append overloads
assign assign overloads
back back overloads
begin Return an iterator to the first element.
capacity Return the number of elements the vector can hold without reallocating.
capacity_in_bytes Return the number of bytes of allocated storage.
clear Remove all elements from the vector.
data Return a pointer to the vector's buffer, even if empty().
emplace_back Construct an element in place at the end using Args.
empty Return true if the vector contains no elements.
end Return an iterator past the last element.
erase erase overloads
front front overloads
insert insert overloads
max_size Return the maximum number of elements the vector can hold.
operator[] Subscript operators
pop_back Destroy and remove the last element of the vector.
pop_back_n Remove the last NumItems elements from the vector.
pop_back_val Remove and return the last element by move.
push_back push_back overloads
rbegin rbegin overloads
rend rend overloads
reserve Ensure capacity for at least N elements.
resize resize overloads
resize_for_overwrite Like resize, but new elements are default-initialized without value construction when T is POD-like.
size Return the number of elements in the vector.
size_in_bytes Return the number of bytes used by the current elements.
swap Exchange the contents of this vector with RHS.
truncate Like resize, but requires that N is less than size().
operator== Return true if this vector and RHS have equal elements.
operator!= Return true if this vector and RHS differ.
operator< Lexicographically compare this vector with RHS.
operator<= Lexicographically compare this vector with RHS for less-or-equal.
operator> Lexicographically compare this vector with RHS for greater-than.
operator>= Lexicographically compare this vector with RHS for greater-or-equal.

Using Declarations

Name
capacity
empty
size

Protected Type Aliases

NameDescription
ValueParamT Parameter type used when passing elements to mutating operations.

Protected Member Functions

NameDescription
SmallVectorImpl [constructor]Construct an empty SmallVectorImpl with inline capacity N.
~SmallVectorImpl [destructor]Destroy storage if the vector grew beyond the inline buffer.
assertSafeToAdd Check whether Elt will be invalidated by increasing the size of the vector by N.
assertSafeToAddRange Check whether any part of the range will be invalidated by growing.
assertSafeToReferenceAfterClear Check whether any part of the range will be invalidated by clearing.
assertSafeToReferenceAfterResize Check whether Elt will be invalidated by resizing the vector to NewSize.
assignRemote Take ownership of RHS's heap allocation, leaving RHS empty and small.
getFirstEl Find the address of the first element. For this pointer math to be valid with small-size of 0 for T with lots of alignment, it's important that SmallVectorStorage is properly-aligned even for small-size of 0.
grow Grow the allocated memory (without initializing new elements), doubling the size of the allocated memory. Guarantees space for at least one more element, or MinSize more elements if specified.
growAndAssign Grow storage and replace contents with NumElts copies of Elt.
growAndEmplaceBack Grow storage and emplace an element at the end using Args.
grow_pod grow_pod overloads
isRangeInStorage Return true if First and Last form a valid (possibly empty) range in this vector's storage.
isReferenceToRange Return true if V is an internal reference to the given range.
isReferenceToStorage Return true if V is an internal reference to this vector.
isSafeToReferenceAfterResize Return true unless Elt will be invalidated by resizing the vector to NewSize.
isSmall Return true if this is a smallvector which has not had dynamic memory allocated for it.
mallocForGrow mallocForGrow overloads
moveElementsForGrow Move existing elements over to the new allocation NewElts, the middle section of grow().
reserveForParamAndGetAddress Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.
resetToSmall Put this vector in a state of being small.
set_allocation_range Set the array data pointer to Begin and capacity to N.
set_size Set the array size to N, which the current array must have enough capacity for.
takeAllocationForGrow Transfer ownership of the allocation, finishing up grow().

Protected Static Member Functions

NameDescription
SizeTypeMax The maximum value of the Size_T used.
destroy_range Destroy the elements in the range []S, E).
forward_value_param forward_value_param overloads
reserveForParamAndGetAddressImpl Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.
uninitialized_copy Copy the range [I, E) onto the uninitialized memory starting with "Dest",] constructing elements as needed.
uninitialized_move Move the range [I, E) into the uninitialized memory starting with "Dest",] constructing elements as needed.

Protected Data Members

NameDescription
BeginX Pointer to the first element, or inline storage.
Capacity Number of elements the current storage can hold without reallocating.
Size Number of constructed elements currently stored.

Protected Static Data Members

NameDescription
TakesParamByValue False when elements are passed by const reference rather than by value.

Protected Using Declarations

Name
TakesParamByValue

Specializations

NameDescription
SmallVectorImpl<APFloat> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<AddressRange> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<AddressRangeValuePair> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<AttributeSpec> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<BlockNode> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<CBufferMapping> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<ConstantRange> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<DescriptorRange> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Edge>
SmallVectorImpl<IRPosition> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<LoadCommandInfo> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<MCOperand> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<MemoryLocation> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<NameIndex> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<PartData> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<RangeTy> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Register> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<ResourceInfo> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<RootParameterInfo> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<SDep> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Segment> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<StringRef>
SmallVectorImpl<Target> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<int> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<long> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<unsigned int> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<unsigned short>
SmallVectorImpl<IntrusiveRefCntPtr<FileSystem>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<PointerIntPair<AADepGraphNode*, 1>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<AllocGroup, Segment>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<SlotIndex, MachineBasicBlock*>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<StringRef, StringRef>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<StringRef, unsigned long>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<StringRef, unique_ptr<GCStrategy>>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<StringRef, CounterInfo*>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<ValueInfo, CalleeInfo>>
SmallVectorImpl<pair<unsigned long, IndexedMemProfRecord>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<pair<DINode const*, DILocation const*>, SmallVector<Entry, 4>>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<pair<DINode const*, DILocation const*>, MachineInstr const*>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<tuple<Value*, Type*, Opcode>, SmallVector<unique_ptr<SeedBundle>>>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<variant<StringRef, unsigned long>, /* implementation-defined */>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<pair<DIMacro*, DIMacroFile*>>
SmallVectorImpl<unique_ptr<GCOVBlock>>
SmallVectorImpl<unique_ptr<GCOVFunction>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<unique_ptr<GCStrategy>> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Arg*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<BasicBlock*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<DDGEdge*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<DDGNode*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<DGNode*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<DICompileUnit*>
SmallVectorImpl<DIGlobalVariableExpression*>
SmallVectorImpl<DIScope*>
SmallVectorImpl<DISubprogram*>
SmallVectorImpl<DIType*>
SmallVectorImpl<Function*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<GCOVArc*>
SmallVectorImpl<Instruction*>
SmallVectorImpl<Instruction*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<LVLocation*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<MCSection*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<MachineBasicBlock*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Node*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<SCC*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<SDDbgLabel*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<SDDbgValue*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<SUnit*>
SmallVectorImpl<VNInfo*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<ValueAsMetadata*>
SmallVectorImpl<void*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<Init const*>
SmallVectorImpl<IrrNode const*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<MCSymbol const*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.
SmallVectorImpl<StringInit const*>
SmallVectorImpl<pair<unsigned long, GlobalValueSummaryInfo> const*> This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.

Non-Member Functions

NameDescription
RecursivelyDeleteTriviallyDeadInstructionsDelete all of the instructions in DeadInsts, and all other instructions that deleting these in turn causes to be trivially dead.
RecursivelyDeleteTriviallyDeadInstructionsPermissiveSame functionality as RecursivelyDeleteTriviallyDeadInstructions, but allow instructions that are not trivially dead. These will be ignored. Returns true if any changes were made, i.e. any instructions trivially dead were found and deleted.
filterDeadComdatFunctionsFilter out potentially dead comdat functions where other entries keep the entire comdat group alive.
findDevirtualizableCallsForTypeCheckedLoadGiven a call to the intrinsic @llvm.type.checked.load, find all devirtualizable call sites based on the call and return them in DevirtCalls.
findDevirtualizableCallsForTypeTestGiven a call to the intrinsic @llvm.type.test, find all devirtualizable call sites based on the call and return them in DevirtCalls.
formLCSSAForInstructionsEnsures LCSSA form for every instruction from the Worklist in the scope of innermost containing loop.
get_thread_nameGet the name of the current thread. The level of support for getting a thread's name varies wildly across operating systems, and it is not even guaranteed that if you can successfully set a thread's name that you can later get it back. This function is intended for diagnostic purposes, and as with setting a thread's name no indication of whether the operation succeeded or failed is returned.
isManyPotentiallyReachableFromManyDetermine whether there is a potentially a path from at least one block in 'Worklist' to at least one block in 'StopSet' within a single function without passing through any of the blocks in 'ExclusionSet'. Returns false only if we can prove that once any block in 'Worklist' has been reached then no blocks in 'StopSet' can be executed without passing through any blocks in 'ExclusionSet'. Conservatively returns true.
isPotentiallyReachableFromManyDetermine whether there is at least one path from a block in 'Worklist' to 'StopBB' without passing through any blocks in 'ExclusionSet', returning true if uncertain.
operator!=Return true if SmallVector LHS differs from ArrayRef RHS.
operator==Return true if SmallVector LHS equals ArrayRef RHS.
AMDGPU::fillValidArchListAMDGCNAppend the valid AMDGCN GPU names to Values. If SubArch is not NoSubArch, only GPUs compatible with that subarch (see isCPUValidForSubArch) are appended.
MachO::replace_extensionReplace extension considering frameworks.
SwitchCG::getJumpTableNumCasesReturn the number of cases within a range.
X86::fillValidCPUArchListProvide a list of valid CPU names. If Only64Bit is true, the list will only contain 64-bit capable CPUs.
X86::fillValidTuneCPUListProvide a list of valid -mtune names.
omp::getBestVariantMatchForContextReturn the index (into VMIs) of the variant with the highest score from the ones applicable in Ctx. See llvm::isVariantApplicableInContext.
yaml::yaml2ObjectFileConvenience function for tests.
sys::fs::current_pathGet the current path.
sys::fs::make_absoluteMake path an absolute path.
sys::path::appendAppend to path.
sys::path::appendAppend to path.
sys::path::cache_directoryGet the directory where installed packages should put their machine-local cache, e.g. $XDG_CACHE_HOME.
sys::path::home_directoryGet the user's home directory.
sys::path::make_preferredFor Windows path styles, convert path to use the preferred path separators. For other styles, do nothing.
sys::path::nativeConvert path to the native form in place. This is used to give paths to users and operating system calls in the platform's normal way. For example, on Windows all '/' are converted to ''.
sys::path::remove_dotsRemove './' and optionally '../' components, and canonicalize separators.
sys::path::remove_filenameRemove the last component from path unless it is the root dir.
sys::path::replace_extensionReplace the file extension of path with extension.
sys::path::replace_path_prefixReplace matching path prefix with another path.
sys::path::user_config_directoryGet the directory where packages should read user-specific configurations. e.g. $XDG_CONFIG_HOME.

Derived Classes

NameDescription
SmallVector Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>).