Encapsulates the information needed to find the file referenced by a #include or #include_next, (sub-)framework lookup, etc. More...
#include "clang/Lex/HeaderSearch.h"
nullopt
if none is found.
Encapsulates the information needed to find the file referenced by a #include or #include_next, (sub-)framework lookup, etc.
Definition at line 237 of file HeaderSearch.h.
◆ HeaderSearch() [1/2] ◆ HeaderSearch() [2/2] ◆ AddIncludeAlias() void clang::HeaderSearch::AddIncludeAlias ( StringRef Source, StringRef Dest ) inline ◆ AddSearchPath() ◆ AddSystemSearchPath() void clang::HeaderSearch::AddSystemSearchPath ( const DirectoryLookup & dir ) inline ◆ angled_dir_begin() ◆ angled_dir_end() ◆ ClearFileInfo() void clang::HeaderSearch::ClearFileInfo ( ) inlineForget everything we know about headers so far.
Definition at line 442 of file HeaderSearch.h.
◆ collectAllModules() ◆ collectVFSUsageAndClear() std::vector< bool > HeaderSearch::collectVFSUsageAndClear ( ) const ◆ computeUserEntryUsage() std::vector< bool > HeaderSearch::computeUserEntryUsage ( ) constDetermine which HeaderSearchOptions::UserEntries have been successfully used so far and mark their index with 'true' in the resulting bit vector.
Note: implicit module maps don't contribute to entry usage.
Definition at line 131 of file HeaderSearch.cpp.
References E.
◆ CreateHeaderMap() ◆ findAllModulesForHeader() ◆ findModuleForHeader() ◆ findResolvedModulesForHeader() ◆ getCachedModuleFileName() [1/2] std::string HeaderSearch::getCachedModuleFileName ( Module * Module ) ◆ getCachedModuleFileName() [2/2] std::string HeaderSearch::getCachedModuleFileName ( StringRef ModuleName, StringRef ModuleMapPath )Retrieve the name of the (to-be-)cached module file that should be used to load a module with the given name.
ModuleName
uniquely identifies this module. See Module::ModuleMap.
Definition at line 254 of file HeaderSearch.cpp.
References getModuleCachePath().
◆ getDiags() ◆ getExistingFileInfo()Return the HeaderFileInfo structure for the specified FileEntry, if it has ever been filled in (either locally or externally).
Definition at line 1328 of file HeaderSearch.cpp.
References clang::FileEntryRef::getUID(), clang::HeaderFileInfo::IsValid, mergeHeaderFileInfo(), and clang::HeaderFileInfo::Resolved.
Referenced by findAllModulesForHeader(), findModuleForHeader(), findResolvedModulesForHeader(), getFileDirFlavor(), hasFileBeenImported(), isFileMultipleIncludeGuarded(), LookupFile(), LookupSubframeworkHeader(), and MarkFileModuleHeader().
◆ getExistingLocalFileInfo() ◆ getExternalLookup() ◆ getFileDirFlavor() ◆ getFileInfo()Return the HeaderFileInfo structure for the specified FileEntry, in preparation for updating it in some way.
Definition at line 1306 of file HeaderSearch.cpp.
References clang::HeaderFileInfo::External, clang::FileEntryRef::getUID(), clang::HeaderFileInfo::IsValid, mergeHeaderFileInfo(), and clang::HeaderFileInfo::Resolved.
Referenced by clang::Preprocessor::alreadyIncluded(), LookupFile(), LookupSubframeworkHeader(), MarkFileIncludeOnce(), MarkFileModuleHeader(), MarkFileSystemHeader(), clang::Preprocessor::markIncluded(), SetFileControllingMacro(), and ShouldEnterIncludeFile().
◆ getFileMgr() FileManager & clang::HeaderSearch::getFileMgr ( ) const inline ◆ getHeaderMapFileNames() void HeaderSearch::getHeaderMapFileNames ( SmallVectorImpl< std::string > & Names ) const ◆ getHeaderSearchOpts() ◆ getIncludeNameForHeader() StringRef HeaderSearch::getIncludeNameForHeader ( const FileEntry * File ) const ◆ getModuleCachePath() StringRef clang::HeaderSearch::getModuleCachePath ( ) const inline ◆ getModuleHash() StringRef clang::HeaderSearch::getModuleHash ( ) const inline ◆ getModuleMap() [1/2] ModuleMap & clang::HeaderSearch::getModuleMap ( ) inlineRetrieve the module map.
Definition at line 821 of file HeaderSearch.h.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnPrivateModuleFragmentDecl(), clang::tooling::dependencies::ModuleDepCollector::applyDiscoveredDependencies(), clang::ApplyHeaderSearchOptions(), clang::DependencyCollector::attachToPreprocessor(), clang::ModuleDependencyCollector::attachToPreprocessor(), clang::FrontendAction::BeginSourceFile(), compileModule(), clang::Preprocessor::EnterSubmodule(), getCachedModuleFileName(), getInputBufferForModule(), clang::Preprocessor::getModuleForLocation(), getPrebuiltImplicitModuleFileName(), clang::CompilerInstance::loadGlobalModuleIndex(), clang::CompilerInstance::loadModule(), loadModuleMapForModuleBuild(), clang::serialization::ModuleManager::lookupByModuleName(), clang::Preprocessor::LookupFile(), prepareToBuildModule(), and suggestModule().
◆ getModuleMap() [2/2] const ModuleMap & clang::HeaderSearch::getModuleMap ( ) const inline ◆ getPrebuiltImplicitModuleFileName() std::string HeaderSearch::getPrebuiltImplicitModuleFileName ( Module * Module ) ◆ getPrebuiltModuleFileName() std::string HeaderSearch::getPrebuiltModuleFileName ( StringRef ModuleName, bool FileMapOnly =false
)
Retrieve the name of the prebuilt module file that should be used to load a module with the given name.
Definition at line 205 of file HeaderSearch.cpp.
References getFileMgr(), and clang::Result.
Referenced by selectModuleSource().
◆ getTotalMemory() ◆ getUniqueFrameworkName() StringRef HeaderSearch::getUniqueFrameworkName ( StringRef Framework ) ◆ hasFileBeenImported() ◆ HasIncludeAliasMap() bool clang::HeaderSearch::HasIncludeAliasMap ( ) const inline ◆ hasModuleMap() ◆ header_file_size() ◆ isFileMultipleIncludeGuarded() ◆ loadModuleMapFile()Read the contents of the given module map file.
Definition at line 1723 of file HeaderSearch.cpp.
References clang::File, getHeaderSearchOpts(), clang::DirectoryEntryRef::getName(), clang::FileManager::getOptionalDirectoryRef(), and clang::FileManager::getVirtualFileRef().
Referenced by clang::FrontendAction::BeginSourceFile(), collectAllModules(), hasModuleMap(), loadModuleMapForModuleBuild(), and loadTopLevelSystemModules().
◆ loadTopLevelSystemModules() void HeaderSearch::loadTopLevelSystemModules ( ) ◆ LookupFile() OptionalFileEntryRef HeaderSearch::LookupFile ( StringRef Filename, SourceLocation IncludeLoc, bool isAngled, ConstSearchDirIterator FromDir, ConstSearchDirIterator * CurDirArg, ArrayRef< std::pair< OptionalFileEntryRef, DirectoryEntryRef > > Includers, SmallVectorImpl< char > * SearchPath, SmallVectorImpl< char > * RelativePath, Module * RequestingModule, ModuleMap::KnownHeader * SuggestedModule, bool * IsMapped, bool * IsFrameworkFound, bool SkipCache =false
, bool BuildSystemModule = false
, bool OpenFile = true
, bool CacheFailures = true
)
Given a "foo" or <foo> reference, look up the indicated file, return null on failure.
LookupFile - Given a "foo" or <foo> reference, look up the indicated file, return null on failure.
isAngled indicates whether the file reference is for system #include's or not (i.e. using <> instead of ""). Includers, if non-empty, indicates where the #including file(s) are, in case a relative search is needed. Microsoft mode will pass all #including files.
Definition at line 885 of file HeaderSearch.cpp.
References angled_dir_begin(), clang::SrcMgr::C_System, clang::SrcMgr::C_User, checkMSVCHeaderSearch(), copyString(), diagnoseFrameworkInclude(), clang::HeaderFileInfo::DirInfo, false, clang::File, Filename, clang::First, getExistingFileInfo(), getFileInfo(), clang::DiagnosticsEngine::isIgnored(), Iter, search_dir_begin(), search_dir_end(), and search_dir_nth().
Referenced by clang::FrontendAction::BeginSourceFile(), and clang::Preprocessor::LookupFile().
◆ LookupFrameworkCache()Look up the specified framework name in our framework cache.
Definition at line 521 of file HeaderSearch.h.
◆ lookupModule()Lookup a module Search for a module with the given name.
Definition at line 293 of file HeaderSearch.cpp.
References clang::ModuleMap::findModule(), and lookupModule().
Referenced by clang::Sema::BuildModuleInclude(), clang::Preprocessor::getCurrentModule(), clang::FrontendAction::getCurrentModule(), clang::Preprocessor::getCurrentModuleImplementation(), clang::PCHGenerator::getEmittingModule(), clang::Preprocessor::getModuleForLocation(), getTopImportImplicitModule(), clang::ASTUnit::LoadFromASTFile(), clang::CompilerInstance::loadModule(), lookupModule(), and prepareToBuildModule().
◆ lookupModuleMapFile() ◆ LookupSubframeworkHeader()Look up a subframework for the specified #include file.
LookupSubframeworkHeader - Look up a subframework for the specified #include file.
For example, if #include'ing <HIToolbox/HIToolbox.h> from within ".../Carbon.framework/Headers/Carbon.h", check to see if HIToolbox is a subframework within Carbon.framework. If so, return the FileEntry for the designated file, otherwise return null.
Definition at line 1153 of file HeaderSearch.cpp.
References clang::HeaderFileInfo::DirInfo, clang::File, Filename, getExistingFileInfo(), getFileInfo(), clang::FileEntryRef::getName(), clang::FileManager::getOptionalDirectoryRef(), and clang::FileManager::getOptionalFileRef().
Referenced by clang::Preprocessor::LookupFile().
◆ MapHeaderToIncludeAlias() StringRef clang::HeaderSearch::MapHeaderToIncludeAlias ( StringRef Source ) inlineMaps one header file name to a different header file name, for use with the include_alias pragma.
Note that the source file name should include the angle brackets or quotes. Returns StringRef as null if the header cannot be mapped.
Definition at line 412 of file HeaderSearch.h.
References Iter.
◆ MarkFileIncludeOnce() void clang::HeaderSearch::MarkFileIncludeOnce ( FileEntryRef File ) inline ◆ MarkFileModuleHeader() ◆ MarkFileSystemHeader() void clang::HeaderSearch::MarkFileSystemHeader ( FileEntryRef File ) inline ◆ operator=() ◆ PrintStats() void HeaderSearch::PrintStats ( ) ◆ quoted_dir_begin() ◆ quoted_dir_end() ◆ search_dir_begin() [1/2] ◆ search_dir_begin() [2/2] ◆ search_dir_end() [1/2] ◆ search_dir_end() [2/2] ◆ search_dir_nth() ◆ search_dir_range() [1/2] ◆ search_dir_range() [2/2] ◆ search_dir_size() ◆ searchDirIdx() ◆ setDirectoryHasModuleMap() void clang::HeaderSearch::setDirectoryHasModuleMap ( const DirectoryEntry * Dir ) inlineConsider modules when including files from this directory.
Definition at line 437 of file HeaderSearch.h.
◆ SetExternalLookup() ◆ SetExternalSource()Set the external source of header information.
Definition at line 455 of file HeaderSearch.h.
◆ SetFileControllingMacro() ◆ setModuleCachePath() void clang::HeaderSearch::setModuleCachePath ( StringRef CachePath ) inline ◆ setModuleHash() void clang::HeaderSearch::setModuleHash ( StringRef Hash ) inlineSet the hash to use for module cache paths.
Definition at line 423 of file HeaderSearch.h.
◆ SetSearchPaths() ◆ SetSystemHeaderPrefixes() void clang::HeaderSearch::SetSystemHeaderPrefixes ( ArrayRef< std::pair< std::string, bool > > P ) inlineSet the list of system header prefixes.
Definition at line 391 of file HeaderSearch.h.
References P.
◆ setTarget() void HeaderSearch::setTarget ( const TargetInfo & Target ) ◆ ShouldEnterIncludeFile()Mark the specified file as a target of a #include, #include_next, or #import directive.
File
belongs (this should usually be the SuggestedModule returned by LookupFile/LookupSubframeworkHeader)
Definition at line 1391 of file HeaderSearch.cpp.
References clang::Preprocessor::alreadyIncluded(), clang::File, clang::HeaderFileInfo::getControllingMacro(), getFileInfo(), clang::ModuleMap::isBuiltinHeader(), clang::HeaderFileInfo::isCompilingModuleHeader, clang::HeaderFileInfo::isImport, clang::Preprocessor::isMacroDefined(), clang::Preprocessor::isMacroDefinedInLocalModule(), clang::HeaderFileInfo::isModuleHeader, clang::HeaderFileInfo::isPragmaOnce, clang::HeaderFileInfo::isTextualModuleHeader, clang::Preprocessor::markIncluded(), and clang::ModuleMap::resolveHeaderDirectives().
◆ suggestPathToFileForDiagnostics() [1/2] std::string HeaderSearch::suggestPathToFileForDiagnostics ( FileEntryRef File, llvm::StringRef MainFile, bool * IsAngled =nullptr
) const
Suggest a path by which the specified file could be found, for use in diagnostics to suggest a #include.
Returned path will only contain forward slashes as separators. MainFile is the absolute path of the file that we are generating the diagnostics for. It will try to shorten the path using MainFile location, if none of the include search directories were prefix of File.
Definition at line 1976 of file HeaderSearch.cpp.
References clang::File, and suggestPathToFileForDiagnostics().
Referenced by getHeaderNameForHeader(), and suggestPathToFileForDiagnostics().
◆ suggestPathToFileForDiagnostics() [2/2] std::string HeaderSearch::suggestPathToFileForDiagnostics ( llvm::StringRef File, llvm::StringRef WorkingDir, llvm::StringRef MainFile, bool * IsAngled =nullptr
) const
Suggest a path by which the specified file could be found, for use in diagnostics to suggest a #include.
Returned path will only contain forward slashes as separators. MainFile is the absolute path of the file that we are generating the diagnostics for. It will try to shorten the path using MainFile location, if none of the include search directories were prefix of File.
Definition at line 1982 of file HeaderSearch.cpp.
References clang::File, Filename, isFrameworkStylePath(), and search_dir_range().
◆ system_dir_begin() ◆ system_dir_end() ◆ DirectoryLookupThe documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4