LLVM 22.0.0git
llvm::TrailingObjects< BaseTy, TrailingTys > Class Template Reference

See the file comment for details on the usage of the TrailingObjects type. More...

#include "llvm/Support/TrailingObjects.h"

Inheritance diagram for llvm::TrailingObjects< BaseTy, TrailingTys >:
[legend]

Classes

struct  FixedSizeStorage
 A type where its with_counts template member has a ::type member suitable for use as uninitialized storage for an object with the given trailing object counts. More...
class  FixedSizeStorageOwner
 A type that acts as the owner for an object placed into fixed storage. More...

Public Types

using FirstTrailingType

Public Member Functions

template<typename T>
const TgetTrailingObjects () const
 Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template).
template<typename T>
TgetTrailingObjects ()
 Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template).
const FirstTrailingTypegetTrailingObjects () const
FirstTrailingTypegetTrailingObjects ()
template<typename T>
MutableArrayRef< TgetTrailingObjects (size_t N)
template<typename T>
ArrayRef< TgetTrailingObjects (size_t N) const
MutableArrayRef< FirstTrailingTypegetTrailingObjects (size_t N)
ArrayRef< FirstTrailingTypegetTrailingObjects (size_t N) const
template<typename T>
const TgetTrailingObjectsNonStrict () const
template<typename T>
TgetTrailingObjectsNonStrict ()
template<typename T>
MutableArrayRef< TgetTrailingObjectsNonStrict (size_t N)
template<typename T>
ArrayRef< TgetTrailingObjectsNonStrict (size_t N) const
 TrailingObjects ()=default
 TrailingObjects (const TrailingObjects &)=delete
 TrailingObjects (TrailingObjects &&)=delete
TrailingObjectsoperator= (const TrailingObjects &)=delete
TrailingObjectsoperator= (TrailingObjects &&)=delete

Static Public Member Functions

template<typename... Tys>
static constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > additionalSizeToAlloc (typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts)
 Returns the size of the trailing data, if an object were allocated with the given counts (The counts are in the same order as the template arguments).
template<typename... Tys>
static constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > totalSizeToAlloc (typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts)
 Returns the total size of an object if it were allocated with the given trailing object counts.

Friends

template<int A, typename B, typename T, typename P, typename... M>
class trailing_objects_internal::TrailingObjectsImpl

Detailed Description

template<typename BaseTy, typename... TrailingTys>
class llvm::TrailingObjects< BaseTy, TrailingTys >

See the file comment for details on the usage of the TrailingObjects type.

Definition at line 212 of file TrailingObjects.h.

Member Typedef Documentation

◆ FirstTrailingType

template<typename BaseTy, typename... TrailingTys>
using llvm::TrailingObjects< BaseTy, TrailingTys >::FirstTrailingType
Initial value:
typename std::tuple_element_t<0, std::tuple<TrailingTys...>>

Definition at line 312 of file TrailingObjects.h.

Constructor & Destructor Documentation

◆ TrailingObjects() [1/3]

template<typename BaseTy, typename... TrailingTys>
llvm::TrailingObjects< BaseTy, TrailingTys >::TrailingObjects ( )
default

◆ TrailingObjects() [2/3]

template<typename BaseTy, typename... TrailingTys>
llvm::TrailingObjects< BaseTy, TrailingTys >::TrailingObjects ( const TrailingObjects< BaseTy, TrailingTys > & )
delete

References TrailingObjects().

◆ TrailingObjects() [3/3]

template<typename BaseTy, typename... TrailingTys>
llvm::TrailingObjects< BaseTy, TrailingTys >::TrailingObjects ( TrailingObjects< BaseTy, TrailingTys > && )
delete

References TrailingObjects().

Member Function Documentation

◆ additionalSizeToAlloc()

template<typename BaseTy, typename... TrailingTys>
template<typename... Tys>
constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > llvm::TrailingObjects< BaseTy, TrailingTys >::additionalSizeToAlloc ( typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts)
inlinestaticconstexpr

Returns the size of the trailing data, if an object were allocated with the given counts (The counts are in the same order as the template arguments).

This does not include the size of the base object. The template arguments must be the same as those used in the class; they are supplied here redundantly only so that it's clear what the counts are counting in callers.

Definition at line 386 of file TrailingObjects.h.

◆ getTrailingObjects() [1/8]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
T * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( )
inline

Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template).

The array may have zero or more elements in it.

Definition at line 303 of file TrailingObjects.h.

References T.

◆ getTrailingObjects() [2/8]

template<typename BaseTy, typename... TrailingTys>
FirstTrailingType * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( )
inline

Definition at line 325 of file TrailingObjects.h.

◆ getTrailingObjects() [3/8]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
const T * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( ) const
inline

Returns a pointer to the trailing object array of the given type (which must be one of those specified in the class template).

The array may have zero or more elements in it.

Definition at line 291 of file TrailingObjects.h.

References T.

Referenced by getTrailingObjects(), and getTrailingObjects().

◆ getTrailingObjects() [4/8]

template<typename BaseTy, typename... TrailingTys>
const FirstTrailingType * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( ) const
inline

Definition at line 315 of file TrailingObjects.h.

◆ getTrailingObjects() [5/8]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
MutableArrayRef< T > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( size_t N)
inline

Definition at line 336 of file TrailingObjects.h.

References getTrailingObjects(), and N.

◆ getTrailingObjects() [6/8]

template<typename BaseTy, typename... TrailingTys>
MutableArrayRef< FirstTrailingType > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( size_t N)
inline

Definition at line 344 of file TrailingObjects.h.

References getTrailingObjects(), and N.

◆ getTrailingObjects() [7/8]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
ArrayRef< T > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( size_t N) const
inline

Definition at line 340 of file TrailingObjects.h.

References getTrailingObjects(), and N.

◆ getTrailingObjects() [8/8]

template<typename BaseTy, typename... TrailingTys>
ArrayRef< FirstTrailingType > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjects ( size_t N) const
inline

Definition at line 348 of file TrailingObjects.h.

References getTrailingObjects(), and N.

◆ getTrailingObjectsNonStrict() [1/4]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
T * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjectsNonStrict ( )
inline

Definition at line 361 of file TrailingObjects.h.

References T.

◆ getTrailingObjectsNonStrict() [2/4]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
const T * llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjectsNonStrict ( ) const
inline

Definition at line 354 of file TrailingObjects.h.

References T.

Referenced by getTrailingObjectsNonStrict(), and getTrailingObjectsNonStrict().

◆ getTrailingObjectsNonStrict() [3/4]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
MutableArrayRef< T > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjectsNonStrict ( size_t N)
inline

Definition at line 368 of file TrailingObjects.h.

References getTrailingObjectsNonStrict(), and N.

◆ getTrailingObjectsNonStrict() [4/4]

template<typename BaseTy, typename... TrailingTys>
template<typename T>
ArrayRef< T > llvm::TrailingObjects< BaseTy, TrailingTys >::getTrailingObjectsNonStrict ( size_t N) const
inline

Definition at line 373 of file TrailingObjects.h.

References getTrailingObjectsNonStrict(), and N.

◆ operator=() [1/2]

template<typename BaseTy, typename... TrailingTys>
TrailingObjects & llvm::TrailingObjects< BaseTy, TrailingTys >::operator= ( const TrailingObjects< BaseTy, TrailingTys > & )
delete

References TrailingObjects().

◆ operator=() [2/2]

template<typename BaseTy, typename... TrailingTys>
TrailingObjects & llvm::TrailingObjects< BaseTy, TrailingTys >::operator= ( TrailingObjects< BaseTy, TrailingTys > && )
delete

References TrailingObjects().

◆ totalSizeToAlloc()

template<typename BaseTy, typename... TrailingTys>
template<typename... Tys>
constexpr std::enable_if_t< std::is_same_v< Foo< TrailingTys... >, Foo< Tys... > >, size_t > llvm::TrailingObjects< BaseTy, TrailingTys >::totalSizeToAlloc ( typename trailing_objects_internal::ExtractSecondType< TrailingTys, size_t >::type... Counts)
inlinestaticconstexpr

Returns the total size of an object if it were allocated with the given trailing object counts.

This is the same as additionalSizeToAlloc, except it does include the size of the base object.

Definition at line 398 of file TrailingObjects.h.

Referenced by llvm::ConstantRangeListAttributeImpl::totalSizeToAlloc(), and llvm::StringAttributeImpl::totalSizeToAlloc().

◆ trailing_objects_internal::TrailingObjectsImpl

template<typename BaseTy, typename... TrailingTys>
template<int A, typename B, typename T, typename P, typename... M>
friend class trailing_objects_internal::TrailingObjectsImpl
friend

Definition at line 219 of file TrailingObjects.h.


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