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

Wrapper around Optional<DirectoryEntryRef> 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]
Collaboration diagram for clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr:
Collaboration graph
[legend]

Public Member Functions

 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ()=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&)=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &)=default
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&)=default
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &)=default
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (llvm::NoneType)
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (DirectoryEntryRef Ref)
 
 OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr (Optional< DirectoryEntryRef > MaybeRef)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (llvm::NoneType)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (DirectoryEntryRef Ref)
 
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtroperator= (Optional< DirectoryEntryRef > 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 Optional<DirectoryEntryRef> More...
 

Detailed Description

Wrapper around Optional<DirectoryEntryRef> 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 Optional<DirectoryEntryRef> 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.
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 Optional<DirectoryEntryRef>.

Definition at line 265 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 ( llvm::NoneType  )
inline

Definition at line 278 of file DirectoryEntry.h.

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [5/6]

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

Definition at line 279 of file DirectoryEntry.h.

◆ OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() [6/6]

clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr ( Optional< DirectoryEntryRef MaybeRef)
inline

Definition at line 281 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 Optional<DirectoryEntryRef>

Definition at line 301 of file DirectoryEntry.h.

◆ operator=() [1/5]

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

◆ operator=() [2/5]

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

Definition at line 288 of file DirectoryEntry.h.

◆ operator=() [3/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr& clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( llvm::NoneType  )
inline

Definition at line 284 of file DirectoryEntry.h.

◆ operator=() [4/5]

OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr& clang::OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr::operator= ( Optional< DirectoryEntryRef MaybeRef)
inline

Definition at line 293 of file DirectoryEntry.h.

◆ operator=() [5/5]

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

The documentation for this class was generated from the following file:
llvm::Optional
Definition: LLVM.h:40