clang  6.0.0svn
Public Member Functions | 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]
Collaboration diagram for clang::LazyOffsetPtr< T, OffsT, Get >:
Collaboration graph
[legend]

Public Member Functions

 LazyOffsetPtr ()
 
 LazyOffsetPtr (T *Ptr)
 
 LazyOffsetPtr (uint64_t Offset)
 
LazyOffsetPtroperator= (T *Ptr)
 
LazyOffsetPtroperator= (uint64_t Offset)
 
 operator bool () const
 Whether this pointer is non-NULL. More...
 
bool isValid () const
 Whether this pointer is non-NULL. More...
 
bool isOffset () const
 Whether this pointer is currently stored as an offset. More...
 
Tget (ExternalASTSource *Source) const
 Retrieve the pointer to the AST node that this lazy pointer. More...
 

Public Attributes

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

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 326 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 ( )
inline

Definition at line 335 of file ExternalASTSource.h.

◆ LazyOffsetPtr() [2/3]

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

Definition at line 337 of file ExternalASTSource.h.

◆ LazyOffsetPtr() [3/3]

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

Definition at line 338 of file ExternalASTSource.h.

Member Function Documentation

◆ get()

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

Retrieve the pointer to the AST node that this lazy pointer.

Parameters
Sourcethe external AST source.
Returns
a pointer to the AST node.

Definition at line 377 of file ExternalASTSource.h.

Referenced by clang::FunctionDecl::getBody(), and clang::ASTContext::setNonKeyFunction().

◆ isOffset()

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

Whether this pointer is currently stored as an offset.

Definition at line 370 of file ExternalASTSource.h.

◆ 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 367 of file ExternalASTSource.h.

Referenced by 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 362 of file ExternalASTSource.h.

◆ operator=() [1/2]

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

Definition at line 344 of file ExternalASTSource.h.

◆ operator=() [2/2]

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

Definition at line 349 of file ExternalASTSource.h.

Member Data Documentation

◆ Ptr

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

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 332 of file ExternalASTSource.h.


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