clang 19.0.0git
Public Member Functions | Friends | List of all members
clang::CanonicalDeclPtr< decl_type > Class Template Reference

A wrapper class around a pointer that always points to its canonical declaration. More...

#include "clang/AST/Redeclarable.h"

Inheritance diagram for clang::CanonicalDeclPtr< decl_type >:
Inheritance graph
[legend]

Public Member Functions

 CanonicalDeclPtr ()=default
 
 CanonicalDeclPtr (decl_type *Ptr)
 
 CanonicalDeclPtr (const CanonicalDeclPtr &)=default
 
CanonicalDeclPtroperator= (const CanonicalDeclPtr &)=default
 
 operator decl_type * ()
 
 operator const decl_type * () const
 
decl_type * operator-> ()
 
const decl_type * operator-> () const
 
decl_type & operator* ()
 
const decl_type & operator* () const
 

Friends

struct llvm::DenseMapInfo< CanonicalDeclPtr< decl_type > >
 
struct llvm::PointerLikeTypeTraits< CanonicalDeclPtr< decl_type > >
 
bool operator== (CanonicalDeclPtr LHS, CanonicalDeclPtr RHS)
 
bool operator!= (CanonicalDeclPtr LHS, CanonicalDeclPtr RHS)
 

Detailed Description

template<typename decl_type>
class clang::CanonicalDeclPtr< decl_type >

A wrapper class around a pointer that always points to its canonical declaration.

CanonicalDeclPtr<decl_type> behaves just like decl_type*, except we call decl_type::getCanonicalDecl() on construction.

This is useful for hashtables that you want to be keyed on a declaration's canonical decl – if you use CanonicalDeclPtr as the key, you don't need to remember to call getCanonicalDecl() everywhere.

Definition at line 349 of file Redeclarable.h.

Constructor & Destructor Documentation

◆ CanonicalDeclPtr() [1/3]

template<typename decl_type >
clang::CanonicalDeclPtr< decl_type >::CanonicalDeclPtr ( )
default

◆ CanonicalDeclPtr() [2/3]

template<typename decl_type >
clang::CanonicalDeclPtr< decl_type >::CanonicalDeclPtr ( decl_type *  Ptr)
inline

Definition at line 352 of file Redeclarable.h.

◆ CanonicalDeclPtr() [3/3]

template<typename decl_type >
clang::CanonicalDeclPtr< decl_type >::CanonicalDeclPtr ( const CanonicalDeclPtr< decl_type > &  )
default

Member Function Documentation

◆ operator const decl_type *()

template<typename decl_type >
clang::CanonicalDeclPtr< decl_type >::operator const decl_type * ( ) const
inline

Definition at line 358 of file Redeclarable.h.

◆ operator decl_type *()

template<typename decl_type >
clang::CanonicalDeclPtr< decl_type >::operator decl_type * ( )
inline

Definition at line 357 of file Redeclarable.h.

◆ operator*() [1/2]

template<typename decl_type >
decl_type & clang::CanonicalDeclPtr< decl_type >::operator* ( )
inline

Definition at line 363 of file Redeclarable.h.

◆ operator*() [2/2]

template<typename decl_type >
const decl_type & clang::CanonicalDeclPtr< decl_type >::operator* ( ) const
inline

Definition at line 364 of file Redeclarable.h.

◆ operator->() [1/2]

template<typename decl_type >
decl_type * clang::CanonicalDeclPtr< decl_type >::operator-> ( )
inline

Definition at line 360 of file Redeclarable.h.

◆ operator->() [2/2]

template<typename decl_type >
const decl_type * clang::CanonicalDeclPtr< decl_type >::operator-> ( ) const
inline

Definition at line 361 of file Redeclarable.h.

◆ operator=()

template<typename decl_type >
CanonicalDeclPtr & clang::CanonicalDeclPtr< decl_type >::operator= ( const CanonicalDeclPtr< decl_type > &  )
default

Friends And Related Function Documentation

◆ llvm::DenseMapInfo< CanonicalDeclPtr< decl_type > >

template<typename decl_type >
friend struct llvm::DenseMapInfo< CanonicalDeclPtr< decl_type > >
friend

Definition at line 369 of file Redeclarable.h.

◆ llvm::PointerLikeTypeTraits< CanonicalDeclPtr< decl_type > >

template<typename decl_type >
friend struct llvm::PointerLikeTypeTraits< CanonicalDeclPtr< decl_type > >
friend

Definition at line 369 of file Redeclarable.h.

◆ operator!=

template<typename decl_type >
bool operator!= ( CanonicalDeclPtr< decl_type >  LHS,
CanonicalDeclPtr< decl_type >  RHS 
)
friend

Definition at line 369 of file Redeclarable.h.

◆ operator==

template<typename decl_type >
bool operator== ( CanonicalDeclPtr< decl_type >  LHS,
CanonicalDeclPtr< decl_type >  RHS 
)
friend

Definition at line 366 of file Redeclarable.h.


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