SmallString ‐ A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. operator+ etc).

Synopsis

Declared in <llvm/ADT/SmallString.h>

template<unsigned int InternalLen>
class SmallString
    : public SmallVector<char, InternalLen>

Base Classes

Name

Description

SmallVector<char, InternalLen>

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

Type Aliases

Name

Description

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

Name

Description

SmallString [constructor]

Constructors

operator=

Assignment operators

append

append overloads

assign

assign overloads

back

back overloads

begin

Return an iterator to the first element.

c_str

Return a null‐terminated C string view of this buffer.

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.

compare

compare ‐ Compare two strings; the result is negative, zero, or positive if this string is lexicographically less than, equal to, or greater than the RHS.

compare_insensitive

compare_insensitive ‐ Compare two strings, ignoring case.

compare_numeric

compare_numeric ‐ Compare two strings, treating sequences of digits as numbers.

contains

contains overloads

count

count overloads

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.

ends_with

ends_with overloads

equals

Check for string equality. This is more efficient than compare() when the relative ordering of inequal strings isn't needed.

equals_insensitive

Check for string equality, ignoring case.

erase

erase overloads

find

find overloads

find_first_not_of

find_first_not_of overloads

find_first_of

find_first_of overloads

find_last_of

find_last_of overloads

front

front overloads

insert

insert overloads

max_size

Return the maximum number of elements the vector can hold.

operator+=

Addition assignment operators

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.

rfind

rfind overloads

size

Return the number of elements in the vector.

size_in_bytes

Return the number of bytes used by the current elements.

slice

Return a reference to the substring from [Start, End).]

starts_with

starts_with overloads

str

Explicit conversion to StringRef.

substr

Return a reference to the substring from [Start, Start + N).]

swap

Exchange the contents of this vector with RHS.

truncate

Like resize, but requires that N is less than size().

operator StringRef

Implicit conversion to StringRef.

operator std::string

Explicit conversion to std::string, copying the characters.

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

Description

append

Inherit append overloads from SmallVector.

assign

Inherit assign overloads from SmallVector.

capacity

Inherit capacity() from SmallVectorBase.

empty

Inherit empty() from SmallVectorBase.

size

Inherit size() from SmallVectorBase.

Protected Type Aliases

Name

Description

ValueParamT

Parameter type used when passing elements to mutating operations.

Protected Member Functions

Name

Description

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

Return a pointer to the first element of inline storage.

grow

Grow the allocated memory without initializing new elements.

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

Name

Description

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 uninitialized memory starting at Dest.

uninitialized_move

Move the range []`I,` E) into uninitialized memory starting at Dest.

Protected Data Members

Name

Description

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

Name

Description

TakesParamByValue

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

Protected Using Declarations

Name

Description

TakesParamByValue

Whether element parameters are passed by value rather than by const reference.

Non-Member Functions

Name

Description

ComputeASanStackFrameDescription

Compute a frame description string for AddressSanitizer reports.

ComputeASanStackFrameLayout

Compute the AddressSanitizer layout of a stack frame.

GetShadowBytes

Return shadow bytes for a stack frame with all locals in scope.

GetShadowBytesAfterScope

Return shadow bytes after all locals have gone out of scope.

RecursivelyDeleteTriviallyDeadInstructions

Recursively delete a worklist of trivially dead instructions.

RecursivelyDeleteTriviallyDeadInstructionsPermissive

Recursively delete trivially dead instructions from a permissive worklist.

appendLEB128

Append a LEB128‐encoded value to a byte buffer.

capacity_in_bytes

Return the capacity of X in bytes.

filterDeadComdatFunctions

Filter out potentially dead comdat functions where other entries keep the entire comdat group alive.

findDevirtualizableCallsForTypeCheckedLoad

Given a call to the intrinsic @llvm.type.checked.load, find all devirtualizable call sites based on the call and return them in DevirtCalls.

findDevirtualizableCallsForTypeTest

Given a call to the intrinsic @llvm.type.test, find all devirtualizable call sites based on the call and return them in DevirtCalls.

formLCSSAForInstructions

Ensures LCSSA form for every instruction from the Worklist in the scope of innermost containing loop.

getDisjunctionWeights

Get the branch weights of a branch conditioned on b1 || b2.

getPrefetchTargetSymbolName

Return the symbol name for a prefetch target.

get_thread_name

Get the name of the current thread.

isManyPotentiallyReachableFromMany

Determine whether any block in Worklist can reach any block in StopSet.

isPotentiallyReachableFromMany

Determine whether any block in Worklist can reach StopBB.

operator!=

Return true if SmallVector LHS differs from ArrayRef RHS.

operator==

Return true if SmallVector LHS equals ArrayRef RHS.

prepareTempFiles

Ensures temporary files exist, creating or re‐using them.

setDefaultDebuginfodUrls

Sets the list of debuginfod server URLs to query. This overrides the environment variable DEBUGINFOD_URLS.

AArch64::fillValidCPUArchList

Append all valid CPU and architecture names to Values.

AMDGPU::fillValidArchListAMDGCN

Append the valid AMDGCN GPU names to Values.

AMDGPU::fillValidArchListR600

Append the valid R600 GPU names to Values.

ARM::fillValidCPUArchList

Append every valid ARM CPU name to Values.

CSKY::fillValidCPUArchList

Append every valid CSKY CPU name to Values.

LoongArch::fillValidCPUList

Append every valid LoongArch CPU name to Values.

MachO::replace_extension

Replace extension considering frameworks.

PPC::fillValidCPUList

Append every valid PowerPC CPU name to Values.

PPC::fillValidTuneCPUList

Append every valid PowerPC tune CPU name to Values.

RISCV::fillValidCPUArchList

Append every valid RISC‐V CPU name for the given bitness to Values.

RISCV::fillValidTuneCPUArchList

Append every valid RISC‐V tune CPU name for the given bitness to Values.

RISCV::getAllTuneFeatures

Append every recognized RISC‐V tune‐feature name to TuneFeatures.

SwitchCG::getJumpTableNumCases

Return the number of cases within a range.

X86::fillValidCPUArchList

Provide a list of valid CPU names. If Only64Bit is true, the list will only contain 64‐bit capable CPUs.

X86::fillValidTuneCPUList

Provide a list of valid ‐mtune names.

XCOFF::getExtendedTBTableFlagString

Return a space‐separated string of extended traceback‐table flag names.

XCOFF::parseParmsType

Decode fixed and floating parameter types from a traceback‐table bitfield.

XCOFF::parseParmsTypeWithVecInfo

Decode fixed, floating, and vector parameter types from a bitfield.

XCOFF::parseVectorParmsType

Decode vector parameter element types from a traceback‐table bitfield.

Xtensa::fillValidCPUList

Append every valid Xtensa CPU name (and aliases) to Values.

omp::getBestVariantMatchForContext

Return the index (into VMIs) of the variant with the highest score from the ones applicable in Ctx. See llvm::isVariantApplicableInContext.

yaml::yaml2ObjectFile

Convenience function for tests.

support::endian::write

Append V to Out using the given byte order.

sys::fs::current_path

Get the current path.

sys::fs::make_absolute

Make path an absolute path.

sys::path::append

Append path components using path style separators.

sys::path::append

Append to path.

sys::path::append

Append to path.

sys::path::cache_directory

Get the directory where installed packages should put their machine‐local cache, e.g. $XDG_CACHE_HOME.

sys::path::home_directory

Get the user's home directory.

sys::path::make_preferred

For Windows path styles, convert path to use the preferred path separators. For other styles, do nothing.

sys::path::native

Convert path to the native form in place.

sys::path::remove_dots

Remove './' and optionally '../' components, and canonicalize separators.

sys::path::remove_filename

Remove the last component from path unless it is the root dir.

sys::path::replace_extension

Replace the file extension of path with extension.

sys::path::replace_path_prefix

Replace matching path prefix with another path.

sys::path::user_config_directory

Get the directory where packages should read user‐specific configurations. e.g. $XDG_CONFIG_HOME.

Created with MrDocs