clang  14.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. More...
 
 DirectoryEntryRef ()=delete
 
 DirectoryEntryRef (const MapEntry &ME)
 
 operator const DirectoryEntry * () const
 Allow DirectoryEntryRef to degrade into 'const DirectoryEntry*' to facilitate incremental adoption. More...
 

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

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 45 of file DirectoryEntry.h.

Member Typedef Documentation

◆ MapEntry

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

Definition at line 57 of file DirectoryEntry.h.

Constructor & Destructor Documentation

◆ DirectoryEntryRef() [1/2]

clang::DirectoryEntryRef::DirectoryEntryRef ( )
delete

◆ DirectoryEntryRef() [2/2]

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

Definition at line 65 of file DirectoryEntry.h.

Member Function Documentation

◆ getDirEntry()

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

Definition at line 47 of file DirectoryEntry.h.

Referenced by operator const DirectoryEntry *().

◆ getMapEntry()

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

Definition at line 59 of file DirectoryEntry.h.

◆ getName()

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

Definition at line 49 of file DirectoryEntry.h.

◆ isSameRef()

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

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

Definition at line 62 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 84 of file DirectoryEntry.h.

References getDirEntry().

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 53 of file DirectoryEntry.h.

◆ llvm::DenseMapInfo< DirectoryEntryRef >

friend struct llvm::DenseMapInfo< DirectoryEntryRef >
friend

Definition at line 94 of file DirectoryEntry.h.


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