clang 22.0.0git
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

Referenced by hash_value, and isSameRef().

◆ 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

◆ getMapEntry()

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

◆ getName()

◆ 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.

References DirectoryEntryRef().

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.

◆ FileMgr::MapEntryOptionalStorage< DirectoryEntryRef >

Definition at line 87 of file DirectoryEntry.h.

References getDirEntry().

◆ 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.

References DirectoryEntryRef(), getDirEntry(), and llvm::hash_value().

◆ 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: