class SmallVectorBase

Declaration

template <class Size_T>
class SmallVectorBase { /* full declaration omitted */ };

Description

This is all the stuff common to all SmallVectors. The template parameter specifies the type which should be used to hold the Size and Capacity of the SmallVector, so it can be adjusted. Using 32 bit size is desirable to shrink the size of the SmallVector. Using 64 bit size is desirable for cases like SmallVector <char >, where a 32 bit size would limit the vector to ~4GB. SmallVectors are used for buffering bitcode output - which can exceed 4GB.

Declared at: llvm/include/llvm/ADT/SmallVector.h:45

Templates

Size_T

Member Variables

protected void* BeginX
protected Size_T Size = 0
protected Size_T Capacity

Method Overview

Methods

static constexpr size_t SizeTypeMax()

Description

The maximum value of the Size_T used.

Declared at: llvm/include/llvm/ADT/SmallVector.h:51

SmallVectorBase<Size_T>()

Declared at: llvm/include/llvm/ADT/SmallVector.h:55

SmallVectorBase<Size_T>(void* FirstEl,
                        size_t TotalCapacity)

Declared at: llvm/include/llvm/ADT/SmallVector.h:56

Parameters

void* FirstEl
size_t TotalCapacity

size_t capacity() const

Declared at: llvm/include/llvm/ADT/SmallVector.h:71

bool empty() const

Declared at: llvm/include/llvm/ADT/SmallVector.h:73

void grow_pod(void* FirstEl,
              size_t MinSize,
              size_t TSize)

Description

This is an implementation of the grow() method which only works on POD-like data types and is out of line to reduce code duplication. This function will report a fatal error if it cannot increase capacity.

Declared at: llvm/include/llvm/ADT/SmallVector.h:67

Parameters

void* FirstEl
size_t MinSize
size_t TSize

void* mallocForGrow(size_t MinSize,
                    size_t TSize,
                    size_t& NewCapacity)

Description

This is a helper for \a grow() that's out of line to reduce code duplication. This function will report a fatal error if it can't grow at least to \p MinSize.

Declared at: llvm/include/llvm/ADT/SmallVector.h:62

Parameters

size_t MinSize
size_t TSize
size_t& NewCapacity

void set_size(size_t N)

Description

Set the array size to \p N, which the current array must have enough capacity for. This does not construct or destroy any elements in the vector.

Declared at: llvm/include/llvm/ADT/SmallVector.h:80

Parameters

size_t N

size_t size() const

Declared at: llvm/include/llvm/ADT/SmallVector.h:70