clang 20.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
clang::LazyOffsetPtr< T, OffsT, Get > Struct Template Reference

A lazy pointer to an AST node (of base type T) that resides within an external AST source. More...

#include "clang/AST/ExternalASTSource.h"

Inheritance diagram for clang::LazyOffsetPtr< T, OffsT, Get >:
Inheritance graph
[legend]

Public Member Functions

unsigned char GetLSB () const
 
template<typename U >
UAs (bool New) const
 
T *& GetPtr () const
 
uint64_t & GetU64 () const
 
void SetPtr (T *Ptr) const
 
void SetU64 (uint64_t U64) const
 
 LazyOffsetPtr ()=default
 
 LazyOffsetPtr (T *Ptr)
 
 LazyOffsetPtr (uint64_t Offset)
 
LazyOffsetPtroperator= (T *Ptr)
 
LazyOffsetPtroperator= (uint64_t Offset)
 
 operator bool () const
 Whether this pointer is non-NULL.
 
bool isValid () const
 Whether this pointer is non-NULL.
 
bool isOffset () const
 Whether this pointer is currently stored as an offset.
 
Tget (ExternalASTSource *Source) const
 Retrieve the pointer to the AST node that this lazy pointer points to.
 
T ** getAddressOfPointer (ExternalASTSource *Source) const
 Retrieve the address of the AST node pointer.
 

Public Attributes

unsigned char Data [DataSize] = {}
 

Static Public Attributes

static constexpr size_t DataSize = std::max(sizeof(uint64_t), sizeof(T *))
 Either a pointer to an AST node or the offset within the external AST source where the AST node can be found.
 

Detailed Description

template<typename T, typename OffsT, T *(ExternalASTSource::*)(OffsT Offset) Get>
struct clang::LazyOffsetPtr< T, OffsT, Get >

A lazy pointer to an AST node (of base type T) that resides within an external AST source.

The AST node is identified within the external AST source by a 63-bit offset, and can be retrieved via an operation on the external AST source itself.

Definition at line 340 of file ExternalASTSource.h.

Constructor & Destructor Documentation

◆ LazyOffsetPtr() [1/3]

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
clang::LazyOffsetPtr< T, OffsT, Get >::LazyOffsetPtr ( )
default

◆ LazyOffsetPtr() [2/3]

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
clang::LazyOffsetPtr< T, OffsT, Get >::LazyOffsetPtr ( T Ptr)
inlineexplicit

◆ LazyOffsetPtr() [3/3]

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
clang::LazyOffsetPtr< T, OffsT, Get >::LazyOffsetPtr ( uint64_t  Offset)
inlineexplicit

Member Function Documentation

◆ As()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
template<typename U >
U & clang::LazyOffsetPtr< T, OffsT, Get >::As ( bool  New) const
inline

◆ get()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
T * clang::LazyOffsetPtr< T, OffsT, Get >::get ( ExternalASTSource Source) const
inline

◆ getAddressOfPointer()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
T ** clang::LazyOffsetPtr< T, OffsT, Get >::getAddressOfPointer ( ExternalASTSource Source) const
inline

Retrieve the address of the AST node pointer.

Deserializes the pointee if necessary.

Definition at line 422 of file ExternalASTSource.h.

References clang::LazyOffsetPtr< T, OffsT, Get >::get(), and clang::LazyOffsetPtr< T, OffsT, Get >::GetPtr().

◆ GetLSB()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
unsigned char clang::LazyOffsetPtr< T, OffsT, Get >::GetLSB ( ) const
inline

◆ GetPtr()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
T *& clang::LazyOffsetPtr< T, OffsT, Get >::GetPtr ( ) const
inline

◆ GetU64()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
uint64_t & clang::LazyOffsetPtr< T, OffsT, Get >::GetU64 ( ) const
inline

Definition at line 362 of file ExternalASTSource.h.

Referenced by clang::LazyOffsetPtr< T, OffsT, Get >::get().

◆ isOffset()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
bool clang::LazyOffsetPtr< T, OffsT, Get >::isOffset ( ) const
inline

◆ isValid()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
bool clang::LazyOffsetPtr< T, OffsT, Get >::isValid ( ) const
inline

Whether this pointer is non-NULL.

This operation does not require the AST node to be deserialized.

Definition at line 401 of file ExternalASTSource.h.

References clang::LazyOffsetPtr< T, OffsT, Get >::GetPtr(), and clang::LazyOffsetPtr< T, OffsT, Get >::isOffset().

Referenced by clang::ASTContext::getCurrentKeyFunction(), and clang::ObjCMethodDecl::hasBody().

◆ operator bool()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
clang::LazyOffsetPtr< T, OffsT, Get >::operator bool ( ) const
inlineexplicit

Whether this pointer is non-NULL.

This operation does not require the AST node to be deserialized.

Definition at line 396 of file ExternalASTSource.h.

References clang::LazyOffsetPtr< T, OffsT, Get >::GetPtr(), and clang::LazyOffsetPtr< T, OffsT, Get >::isOffset().

◆ operator=() [1/2]

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
LazyOffsetPtr & clang::LazyOffsetPtr< T, OffsT, Get >::operator= ( T Ptr)
inline

◆ operator=() [2/2]

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
LazyOffsetPtr & clang::LazyOffsetPtr< T, OffsT, Get >::operator= ( uint64_t  Offset)
inline

◆ SetPtr()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
void clang::LazyOffsetPtr< T, OffsT, Get >::SetPtr ( T Ptr) const
inline

◆ SetU64()

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
void clang::LazyOffsetPtr< T, OffsT, Get >::SetU64 ( uint64_t  U64) const
inline

Member Data Documentation

◆ Data

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
unsigned char clang::LazyOffsetPtr< T, OffsT, Get >::Data[DataSize] = {}
mutable

◆ DataSize

template<typename T , typename OffsT , T *(ExternalASTSource::*)(OffsT Offset) Get>
constexpr size_t clang::LazyOffsetPtr< T, OffsT, Get >::DataSize = std::max(sizeof(uint64_t), sizeof(T *))
staticconstexpr

Either a pointer to an AST node or the offset within the external AST source where the AST node can be found.

If the low bit is clear, a pointer to the AST node. If the low bit is set, the upper 63 bits are the offset.

Definition at line 346 of file ExternalASTSource.h.

Referenced by clang::LazyOffsetPtr< T, OffsT, Get >::As(), and clang::LazyOffsetPtr< T, OffsT, Get >::GetLSB().


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