clang 20.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
clang::DirectoryEntryRef Class Reference

A reference to a DirectoryEntry that includes the name of the directory as it was accessed by the FileManager's client. More...

#include "clang/Basic/DirectoryEntry.h"

Public Types

using MapEntry = llvm::StringMapEntry< llvm::ErrorOr< DirectoryEntry & > >
 

Public Member Functions

const DirectoryEntrygetDirEntry () const
 
StringRef getName () const
 
const MapEntrygetMapEntry () const
 
bool isSameRef (DirectoryEntryRef RHS) const
 Check if RHS referenced the file in exactly the same way.
 
 DirectoryEntryRef ()=delete
 
 DirectoryEntryRef (const MapEntry &ME)
 
 operator const DirectoryEntry * () const
 Allow DirectoryEntryRef to degrade into 'const DirectoryEntry*' to facilitate incremental adoption.
 

Friends

class FileMgr::MapEntryOptionalStorage< DirectoryEntryRef >
 
struct llvm::DenseMapInfo< DirectoryEntryRef >
 
llvm::hash_code hash_value (DirectoryEntryRef Ref)
 Hash code is based on the DirectoryEntry, not the specific named reference.
 

Detailed Description

A reference to a DirectoryEntry that includes the name of the directory as it was accessed by the FileManager's client.

Definition at line 48 of file DirectoryEntry.h.

Member Typedef Documentation

◆ MapEntry

using clang::DirectoryEntryRef::MapEntry = llvm::StringMapEntry<llvm::ErrorOr<DirectoryEntry &> >

Definition at line 60 of file DirectoryEntry.h.

Constructor & Destructor Documentation

◆ DirectoryEntryRef() [1/2]

clang::DirectoryEntryRef::DirectoryEntryRef ( )
delete

◆ DirectoryEntryRef() [2/2]

clang::DirectoryEntryRef::DirectoryEntryRef ( const MapEntry ME)
inlineexplicit

Definition at line 68 of file DirectoryEntry.h.

Member Function Documentation

◆ getDirEntry()

const DirectoryEntry & clang::DirectoryEntryRef::getDirEntry ( ) const
inline

Definition at line 50 of file DirectoryEntry.h.

Referenced by clang::FileManager::getFileRef().

◆ getMapEntry()

const MapEntry & clang::DirectoryEntryRef::getMapEntry ( ) const
inline

◆ getName()

StringRef clang::DirectoryEntryRef::getName ( ) const
inline

◆ isSameRef()

bool clang::DirectoryEntryRef::isSameRef ( DirectoryEntryRef  RHS) const
inline

Check if RHS referenced the file in exactly the same way.

Definition at line 65 of file DirectoryEntry.h.

Referenced by llvm::DenseMapInfo< clang::DirectoryEntryRef >::isEqual().

◆ operator const DirectoryEntry *()

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

Allow DirectoryEntryRef to degrade into 'const DirectoryEntry*' to facilitate incremental adoption.

The goal is to avoid code churn due to dances like the following:

// Old code.
lvalue = rvalue;
// Temporary code from an incremental patch.
lvalue = &rvalue.getDirectoryEntry();
// Final code.
lvalue = rvalue;

FIXME: Once DirectoryEntryRef is "everywhere" and DirectoryEntry::getName has been deleted, delete this implicit conversion.

Definition at line 87 of file DirectoryEntry.h.

Friends And Related Function Documentation

◆ FileMgr::MapEntryOptionalStorage< DirectoryEntryRef >

Definition at line 87 of file DirectoryEntry.h.

◆ hash_value

llvm::hash_code hash_value ( DirectoryEntryRef  Ref)
friend

Hash code is based on the DirectoryEntry, not the specific named reference.

Definition at line 56 of file DirectoryEntry.h.

◆ llvm::DenseMapInfo< DirectoryEntryRef >

friend struct llvm::DenseMapInfo< DirectoryEntryRef >
friend

Definition at line 95 of file DirectoryEntry.h.


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