clang 18.0.0git
Public Member Functions | List of all members
clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr Class Reference

Wrapper around OptionalDirectoryEntryRef that degrades to 'const DirectoryEntry*', facilitating incremental patches to propagate DirectoryEntryRef. More...

#include "clang/Basic/DirectoryEntry.h"

Inheritance diagram for clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr:
Inheritance graph
[legend]

Public Member Functions

 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ()=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&)=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &)=default
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&)=default
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &)=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (std::nullopt_t)
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (DirectoryEntryRef Ref)
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (OptionalDirectoryEntryRef MaybeRef)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (std::nullopt_t)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (DirectoryEntryRef Ref)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (OptionalDirectoryEntryRef MaybeRef)
 
 operator const DirectoryEntry * () const
 Degrade to 'const DirectoryEntry *' to allow DirectoryEntry::LastRef and DirectoryEntry::getName have been deleted, delete this class and replace instances with OptionalDirectoryEntryRef.
 
- Public Member Functions inherited from clang::CustomizableOptional< DirectoryEntryRef >
constexpr CustomizableOptional ()=default
 
constexpr CustomizableOptional (std::nullopt_t)
 
constexpr CustomizableOptional (const DirectoryEntryRef &y)
 
constexpr CustomizableOptional (const CustomizableOptional &O)=default
 
constexpr CustomizableOptional (DirectoryEntryRef &&y)
 
constexpr CustomizableOptional (CustomizableOptional &&O)=default
 
constexpr CustomizableOptional (std::in_place_t, ArgTypes &&...Args)
 
constexpr CustomizableOptional (const std::optional< DirectoryEntryRef > &y)
 
constexpr CustomizableOptional (std::optional< DirectoryEntryRef > &&y)
 
CustomizableOptionaloperator= (DirectoryEntryRef &&y)
 
CustomizableOptionaloperator= (CustomizableOptional &&O)=default
 
CustomizableOptionaloperator= (const DirectoryEntryRef &y)
 
CustomizableOptionaloperator= (const CustomizableOptional &O)=default
 
void emplace (ArgTypes &&...Args)
 Create a new object by constructing it in place with the given arguments.
 
void reset ()
 
constexpr const DirectoryEntryRefgetPointer () const
 
DirectoryEntryRefgetPointer ()
 
constexpr const DirectoryEntryRefvalue () const &
 
DirectoryEntryRefvalue () &
 
DirectoryEntryRef && value () &&
 
constexpr operator bool () const
 
constexpr bool has_value () const
 
constexpr const DirectoryEntryRefoperator-> () const
 
DirectoryEntryRefoperator-> ()
 
constexpr const DirectoryEntryRefoperator* () const &
 
DirectoryEntryRefoperator* () &
 
DirectoryEntryRef && operator* () &&
 
constexpr DirectoryEntryRef value_or (U &&alt) const &
 
DirectoryEntryRef value_or (U &&alt) &&
 
 operator std::optional< DirectoryEntryRef > & () const &
 
 operator std::optional< DirectoryEntryRef > && () const &&
 

Additional Inherited Members

- Public Types inherited from clang::CustomizableOptional< DirectoryEntryRef >
using value_type = DirectoryEntryRef
 

Detailed Description

Wrapper around OptionalDirectoryEntryRef that degrades to 'const DirectoryEntry*', facilitating incremental patches to propagate DirectoryEntryRef.

This class can be used as return value or field where it's convenient for an OptionalDirectoryEntryRef to degrade to a 'const DirectoryEntry*'. The purpose is to avoid code churn due to dances like the following:

// Old code.
lvalue = rvalue;
// Temporary code from an incremental patch.
OptionalDirectoryEntryRef MaybeF = rvalue;
lvalue = MaybeF ? &MaybeF.getDirectoryEntry() : nullptr;
// Final code.
lvalue = rvalue;

FIXME: Once DirectoryEntryRef is "everywhere" and DirectoryEntry::LastRef and DirectoryEntry::getName have been deleted, delete this class and replace instances with OptionalDirectoryEntryRef.

Definition at line 272 of file DirectoryEntry.h.

Constructor & Destructor Documentation

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [1/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( )
default

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [2/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&  )
default

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [3/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr )
default

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [4/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( std::nullopt_t  )
inline

Definition at line 285 of file DirectoryEntry.h.

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [5/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( DirectoryEntryRef  Ref)
inline

Definition at line 286 of file DirectoryEntry.h.

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [6/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( OptionalDirectoryEntryRef  MaybeRef)
inline

Definition at line 288 of file DirectoryEntry.h.

Member Function Documentation

◆ operator const DirectoryEntry *()

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator const DirectoryEntry * ( ) const
inline

Degrade to 'const DirectoryEntry *' to allow DirectoryEntry::LastRef and DirectoryEntry::getName have been deleted, delete this class and replace instances with OptionalDirectoryEntryRef.

Definition at line 310 of file DirectoryEntry.h.

References clang::CustomizableOptional< DirectoryEntryRef >::has_value().

◆ operator=() [1/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr )
default

◆ operator=() [2/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( DirectoryEntryRef  Ref)
inline

◆ operator=() [3/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( OptionalDirectoryEntryRef  MaybeRef)
inline

◆ operator=() [4/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&  )
default

◆ operator=() [5/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( std::nullopt_t  )
inline

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