clang 19.0.0git
Classes | Public Types | Public Member Functions | List of all members
clang::DirectoryLookup Class Reference

DirectoryLookup - This class represents one entry in the search list that specifies the search order for directories in #include directives. More...

#include "clang/Lex/DirectoryLookup.h"

Public Types

enum  LookupType_t { LT_NormalDir , LT_Framework , LT_HeaderMap }
 

Public Member Functions

 DirectoryLookup (DirectoryEntryRef Dir, SrcMgr::CharacteristicKind DT, bool isFramework)
 This ctor does not take ownership of 'Dir'.
 
 DirectoryLookup (const HeaderMap *Map, SrcMgr::CharacteristicKind DT, bool isIndexHeaderMap)
 This ctor does not take ownership of 'Map'.
 
LookupType_t getLookupType () const
 getLookupType - Return the kind of directory lookup that this is: either a normal directory, a framework path, or a HeaderMap.
 
StringRef getName () const
 getName - Return the directory or filename corresponding to this lookup object.
 
const DirectoryEntrygetDir () const
 getDir - Return the directory that this entry refers to.
 
OptionalDirectoryEntryRef getDirRef () const
 
const DirectoryEntrygetFrameworkDir () const
 getFrameworkDir - Return the directory that this framework refers to.
 
OptionalDirectoryEntryRef getFrameworkDirRef () const
 
const HeaderMapgetHeaderMap () const
 getHeaderMap - Return the directory that this entry refers to.
 
bool isNormalDir () const
 isNormalDir - Return true if this is a normal directory, not a header map.
 
bool isFramework () const
 isFramework - True if this is a framework directory.
 
bool isHeaderMap () const
 isHeaderMap - Return true if this is a header map, not a normal directory.
 
bool haveSearchedAllModuleMaps () const
 Determine whether we have already searched this entire directory for module maps.
 
void setSearchedAllModuleMaps (bool SAMM)
 Specify whether we have already searched all of the subdirectories for module maps.
 
SrcMgr::CharacteristicKind getDirCharacteristic () const
 DirCharacteristic - The type of directory this is, one of the DirType enum values.
 
bool isSystemHeaderDirectory () const
 Whether this describes a system header directory.
 
bool isIndexHeaderMap () const
 Whether this header map is building a framework or not.
 
OptionalFileEntryRef LookupFile (StringRef &Filename, HeaderSearch &HS, SourceLocation IncludeLoc, SmallVectorImpl< char > *SearchPath, SmallVectorImpl< char > *RelativePath, Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule, bool &InUserSpecifiedSystemFramework, bool &IsFrameworkFound, bool &IsInHeaderMap, SmallVectorImpl< char > &MappedName, bool OpenFile=true) const
 LookupFile - Lookup the specified file in this search path, returning it if it exists or returning null if not.
 

Detailed Description

DirectoryLookup - This class represents one entry in the search list that specifies the search order for directories in #include directives.

It represents either a directory, a framework, or a headermap.

Definition at line 30 of file DirectoryLookup.h.

Member Enumeration Documentation

◆ LookupType_t

Enumerator
LT_NormalDir 
LT_Framework 
LT_HeaderMap 

Definition at line 32 of file DirectoryLookup.h.

Constructor & Destructor Documentation

◆ DirectoryLookup() [1/2]

clang::DirectoryLookup::DirectoryLookup ( DirectoryEntryRef  Dir,
SrcMgr::CharacteristicKind  DT,
bool  isFramework 
)
inline

This ctor does not take ownership of 'Dir'.

Definition at line 72 of file DirectoryLookup.h.

◆ DirectoryLookup() [2/2]

clang::DirectoryLookup::DirectoryLookup ( const HeaderMap Map,
SrcMgr::CharacteristicKind  DT,
bool  isIndexHeaderMap 
)
inline

This ctor does not take ownership of 'Map'.

Definition at line 79 of file DirectoryLookup.h.

Member Function Documentation

◆ getDir()

const DirectoryEntry * clang::DirectoryLookup::getDir ( ) const
inline

getDir - Return the directory that this entry refers to.

Definition at line 94 of file DirectoryLookup.h.

References isNormalDir().

Referenced by LookupFile(), and RemoveDuplicates().

◆ getDirCharacteristic()

SrcMgr::CharacteristicKind clang::DirectoryLookup::getDirCharacteristic ( ) const
inline

DirCharacteristic - The type of directory this is, one of the DirType enum values.

Definition at line 140 of file DirectoryLookup.h.

Referenced by isSystemHeaderDirectory(), and RemoveDuplicates().

◆ getDirRef()

OptionalDirectoryEntryRef clang::DirectoryLookup::getDirRef ( ) const
inline

Definition at line 98 of file DirectoryLookup.h.

References isNormalDir().

Referenced by getName(), and LookupFile().

◆ getFrameworkDir()

const DirectoryEntry * clang::DirectoryLookup::getFrameworkDir ( ) const
inline

getFrameworkDir - Return the directory that this framework refers to.

Definition at line 104 of file DirectoryLookup.h.

References isFramework().

Referenced by RemoveDuplicates().

◆ getFrameworkDirRef()

OptionalDirectoryEntryRef clang::DirectoryLookup::getFrameworkDirRef ( ) const
inline

Definition at line 108 of file DirectoryLookup.h.

References isFramework().

Referenced by getName().

◆ getHeaderMap()

const HeaderMap * clang::DirectoryLookup::getHeaderMap ( ) const
inline

getHeaderMap - Return the directory that this entry refers to.

Definition at line 114 of file DirectoryLookup.h.

References isHeaderMap().

Referenced by getName(), LookupFile(), and RemoveDuplicates().

◆ getLookupType()

LookupType_t clang::DirectoryLookup::getLookupType ( ) const
inline

getLookupType - Return the kind of directory lookup that this is: either a normal directory, a framework path, or a HeaderMap.

Definition at line 86 of file DirectoryLookup.h.

Referenced by isFramework(), isHeaderMap(), isNormalDir(), and RemoveDuplicates().

◆ getName()

StringRef DirectoryLookup::getName ( ) const

getName - Return the directory or filename corresponding to this lookup object.

Definition at line 427 of file HeaderSearch.cpp.

References getDirRef(), clang::HeaderMap::getFileName(), getFrameworkDirRef(), getHeaderMap(), clang::DirectoryEntryRef::getName(), isFramework(), isHeaderMap(), and isNormalDir().

Referenced by LookupFile(), and RemoveDuplicates().

◆ haveSearchedAllModuleMaps()

bool clang::DirectoryLookup::haveSearchedAllModuleMaps ( ) const
inline

Determine whether we have already searched this entire directory for module maps.

Definition at line 130 of file DirectoryLookup.h.

◆ isFramework()

bool clang::DirectoryLookup::isFramework ( ) const
inline

isFramework - True if this is a framework directory.

Definition at line 123 of file DirectoryLookup.h.

References getLookupType(), and LT_Framework.

Referenced by getFrameworkDir(), getFrameworkDirRef(), getName(), LookupFile(), and RemoveDuplicates().

◆ isHeaderMap()

bool clang::DirectoryLookup::isHeaderMap ( ) const
inline

isHeaderMap - Return true if this is a header map, not a normal directory.

Definition at line 126 of file DirectoryLookup.h.

References getLookupType(), and LT_HeaderMap.

Referenced by getHeaderMap(), getName(), isIndexHeaderMap(), LookupFile(), and RemoveDuplicates().

◆ isIndexHeaderMap()

bool clang::DirectoryLookup::isIndexHeaderMap ( ) const
inline

Whether this header map is building a framework or not.

Definition at line 150 of file DirectoryLookup.h.

References isHeaderMap().

◆ isNormalDir()

bool clang::DirectoryLookup::isNormalDir ( ) const
inline

isNormalDir - Return true if this is a normal directory, not a header map.

Definition at line 119 of file DirectoryLookup.h.

References getLookupType(), and LT_NormalDir.

Referenced by getDir(), getDirRef(), getName(), LookupFile(), and RemoveDuplicates().

◆ isSystemHeaderDirectory()

bool clang::DirectoryLookup::isSystemHeaderDirectory ( ) const
inline

Whether this describes a system header directory.

Definition at line 145 of file DirectoryLookup.h.

References clang::SrcMgr::C_User, and getDirCharacteristic().

Referenced by LookupFile().

◆ LookupFile()

OptionalFileEntryRef DirectoryLookup::LookupFile ( StringRef &  Filename,
HeaderSearch HS,
SourceLocation  IncludeLoc,
SmallVectorImpl< char > *  SearchPath,
SmallVectorImpl< char > *  RelativePath,
Module RequestingModule,
ModuleMap::KnownHeader SuggestedModule,
bool InUserSpecifiedSystemFramework,
bool IsFrameworkFound,
bool IsInHeaderMap,
SmallVectorImpl< char > &  MappedName,
bool  OpenFile = true 
) const

LookupFile - Lookup the specified file in this search path, returning it if it exists or returning null if not.

Parameters
FilenameThe file to look up relative to the search paths.
HSThe header search instance to search with.
IncludeLocthe source location of the #include or #import directive.
SearchPathIf not NULL, will be set to the search path relative to which the file was found.
RelativePathIf not NULL, will be set to the path relative to SearchPath at which the file was found. This only differs from the Filename for framework includes.
RequestingModuleThe module in which the lookup was performed.
SuggestedModuleIf non-null, and the file found is semantically part of a known module, this will be set to the module that should be imported instead of preprocessing/parsing the file found.
[out]InUserSpecifiedSystemFrameworkIf the file is found, set to true if the file is located in a framework that has been user-specified to be treated as a system framework.
[out]IsFrameworkFoundFor a framework directory set to true if specified '.framework' directory is found.
[out]MappedNameif this is a headermap which maps the filename to a framework include ("Foo.h" -> "Foo/Foo.h"), set the new name to this vector and point Filename to it.

Definition at line 468 of file HeaderSearch.cpp.

References clang::File, Filename, getDir(), getDirRef(), clang::HeaderSearch::getFileMgr(), getHeaderMap(), clang::DirectoryEntryRef::getName(), getName(), clang::FileManager::getOptionalFileRef(), isFramework(), isHeaderMap(), isNormalDir(), isSystemHeaderDirectory(), clang::HeaderMap::lookupFilename(), and clang::HeaderSearch::searchDirIdx().

◆ setSearchedAllModuleMaps()

void clang::DirectoryLookup::setSearchedAllModuleMaps ( bool  SAMM)
inline

Specify whether we have already searched all of the subdirectories for module maps.

Definition at line 134 of file DirectoryLookup.h.


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