clang 20.0.0git
|
HeaderSearchOptions - Helper class for storing options related to the initialization of the HeaderSearch object. More...
#include "clang/Lex/HeaderSearchOptions.h"
Classes | |
struct | Entry |
struct | SystemHeaderPrefix |
Public Member Functions | |
HeaderSearchOptions (StringRef _Sysroot="/") | |
void | AddPath (StringRef Path, frontend::IncludeDirGroup Group, bool IsFramework, bool IgnoreSysRoot) |
AddPath - Add the Path path to the specified Group list. | |
void | AddSystemHeaderPrefix (StringRef Prefix, bool IsSystemHeader) |
AddSystemHeaderPrefix - Override whether #include directives naming a path starting with Prefix should be considered as naming a system header. | |
void | AddVFSOverlayFile (StringRef Name) |
void | AddPrebuiltModulePath (StringRef Name) |
Public Attributes | |
std::string | Sysroot |
If non-empty, the directory to use as a "virtual system root" for include paths. | |
std::vector< Entry > | UserEntries |
User specified include entries. | |
std::vector< SystemHeaderPrefix > | SystemHeaderPrefixes |
User-specified system header prefixes. | |
std::string | ResourceDir |
The directory which holds the compiler resource files (builtin includes, etc.). | |
std::string | ModuleCachePath |
The directory used for the module cache. | |
std::string | ModuleUserBuildPath |
The directory used for a user build. | |
std::map< std::string, std::string, std::less<> > | PrebuiltModuleFiles |
The mapping of module names to prebuilt module files. | |
std::vector< std::string > | PrebuiltModulePaths |
The directories used to load prebuilt module files. | |
std::string | ModuleFormat |
The module/pch container format. | |
unsigned | DisableModuleHash: 1 |
Whether we should disable the use of the hash string within the module cache. | |
unsigned | ImplicitModuleMaps: 1 |
Implicit module maps. | |
unsigned | ModuleMapFileHomeIsCwd: 1 |
Set the 'home directory' of a module map file to the current working directory (or the home directory of the module map file that contained the 'extern module' directive importing this module map file if any) rather than the directory containing the module map file. | |
unsigned | ModuleFileHomeIsCwd: 1 |
Set the base path of a built module file to be the current working directory. | |
unsigned | EnablePrebuiltImplicitModules: 1 |
Also search for prebuilt implicit modules in the prebuilt module cache path. | |
unsigned | ModuleCachePruneInterval = 7 * 24 * 60 * 60 |
The interval (in seconds) between pruning operations. | |
unsigned | ModuleCachePruneAfter = 31 * 24 * 60 * 60 |
The time (in seconds) after which an unused module file will be considered unused and will, therefore, be pruned. | |
uint64_t | BuildSessionTimestamp = 0 |
The time in seconds when the build session started. | |
llvm::SmallSetVector< llvm::CachedHashString, 16 > | ModulesIgnoreMacros |
The set of macro names that should be ignored for the purposes of computing the module hash. | |
std::vector< std::string > | VFSOverlayFiles |
The set of user-provided virtual filesystem overlay files. | |
unsigned | UseBuiltinIncludes: 1 |
Include the compiler builtin includes. | |
unsigned | UseStandardSystemIncludes: 1 |
Include the system standard include search directories. | |
unsigned | UseStandardCXXIncludes: 1 |
Include the system standard C++ library include search directories. | |
unsigned | UseLibcxx: 1 |
Use libc++ instead of the default libstdc++. | |
unsigned | Verbose: 1 |
Whether header search information should be output as for -v. | |
unsigned | ModulesValidateOncePerBuildSession: 1 |
If true, skip verifying input files used by modules if the module was already verified during this build session (see BuildSessionTimestamp ). | |
unsigned | ModulesValidateSystemHeaders: 1 |
Whether to validate system input files when a module is loaded. | |
unsigned | ValidateASTInputFilesContent: 1 |
unsigned | ForceCheckCXX20ModulesInputFiles: 1 |
unsigned | UseDebugInfo: 1 |
Whether the module includes debug information (-gmodules). | |
unsigned | ModulesValidateDiagnosticOptions: 1 |
unsigned | ModulesSkipDiagnosticOptions: 1 |
Whether to entirely skip writing diagnostic options. | |
unsigned | ModulesSkipHeaderSearchPaths: 1 |
Whether to entirely skip writing header search paths. | |
unsigned | ModulesSkipPragmaDiagnosticMappings: 1 |
Whether to entirely skip writing pragma diagnostic mappings. | |
unsigned | ModulesPruneNonAffectingModuleMaps: 1 |
Whether to prune non-affecting module map files from PCM files. | |
unsigned | ModulesHashContent: 1 |
unsigned | ModulesStrictContextHash: 1 |
Whether we should include all things that could impact the module in the hash. | |
unsigned | ModulesIncludeVFSUsage: 1 |
Whether to include ivfsoverlay usage information in written AST files. | |
unsigned | AllowModuleMapSubdirectorySearch: 1 |
Whether we should look for a module in module maps only in provided header search paths or if we are allowed to look for module maps in subdirectories of provided paths too. | |
HeaderSearchOptions - Helper class for storing options related to the initialization of the HeaderSearch object.
Definition at line 67 of file HeaderSearchOptions.h.
|
inline |
Definition at line 279 of file HeaderSearchOptions.h.
|
inline |
AddPath - Add the Path
path to the specified Group
list.
Definition at line 298 of file HeaderSearchOptions.h.
References Path, and UserEntries.
Referenced by ParseHeaderSearchArgs().
|
inline |
Definition at line 314 of file HeaderSearchOptions.h.
References PrebuiltModulePaths.
Referenced by ParseHeaderSearchArgs().
|
inline |
AddSystemHeaderPrefix - Override whether #include directives naming a path starting with Prefix
should be considered as naming a system header.
Definition at line 306 of file HeaderSearchOptions.h.
References SystemHeaderPrefixes.
Referenced by ParseHeaderSearchArgs().
|
inline |
Definition at line 310 of file HeaderSearchOptions.h.
References VFSOverlayFiles.
Referenced by ParseHeaderSearchArgs().
unsigned clang::HeaderSearchOptions::AllowModuleMapSubdirectorySearch |
Whether we should look for a module in module maps only in provided header search paths or if we are allowed to look for module maps in subdirectories of provided paths too.
Definition at line 277 of file HeaderSearchOptions.h.
uint64_t clang::HeaderSearchOptions::BuildSessionTimestamp = 0 |
The time in seconds when the build session started.
This time is used by other optimizations in header search and module loading.
Definition at line 184 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions(), and clang::ASTReader::ReadAST().
unsigned clang::HeaderSearchOptions::DisableModuleHash |
Whether we should disable the use of the hash string within the module cache.
Note: Only used for testing!
Definition at line 133 of file HeaderSearchOptions.h.
unsigned clang::HeaderSearchOptions::EnablePrebuiltImplicitModules |
Also search for prebuilt implicit modules in the prebuilt module cache path.
Definition at line 160 of file HeaderSearchOptions.h.
Referenced by selectModuleSource().
unsigned clang::HeaderSearchOptions::ForceCheckCXX20ModulesInputFiles |
Definition at line 230 of file HeaderSearchOptions.h.
unsigned clang::HeaderSearchOptions::ImplicitModuleMaps |
Implicit module maps.
This option is enabld by default when modules is enabled.
Definition at line 138 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions().
std::string clang::HeaderSearchOptions::ModuleCachePath |
The directory used for the module cache.
Definition at line 114 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions(), GenerateHeaderSearchArgs(), ParseHeaderSearchArgs(), and pruneModuleCache().
unsigned clang::HeaderSearchOptions::ModuleCachePruneAfter = 31 * 24 * 60 * 60 |
The time (in seconds) after which an unused module file will be considered unused and will, therefore, be pruned.
When the module cache is pruned, any module file that has not been accessed in this many seconds will be removed. The default value is large, e.g., a month, to avoid forcing infrequently-used modules to be regenerated often.
Definition at line 178 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions(), and pruneModuleCache().
unsigned clang::HeaderSearchOptions::ModuleCachePruneInterval = 7 * 24 * 60 * 60 |
The interval (in seconds) between pruning operations.
This operation is expensive, because it requires Clang to walk through the directory structure of the module cache, stat()'ing and removing files.
The default value is large, e.g., the operation runs once a week.
Definition at line 169 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions(), and pruneModuleCache().
unsigned clang::HeaderSearchOptions::ModuleFileHomeIsCwd |
Set the base path of a built module file to be the current working directory.
This is useful for sharing module files across machines that build with different paths without having to rewrite all modulemap files to have working directory relative paths.
Definition at line 155 of file HeaderSearchOptions.h.
std::string clang::HeaderSearchOptions::ModuleFormat |
The module/pch container format.
Definition at line 126 of file HeaderSearchOptions.h.
Referenced by clang::DumpModuleInfoAction::BeginInvocation(), clang::CompilerInvocation::getModuleHash(), clang::CompilerInstance::getPCHContainerReader(), and clang::CompilerInstance::getPCHContainerWriter().
unsigned clang::HeaderSearchOptions::ModuleMapFileHomeIsCwd |
Set the 'home directory' of a module map file to the current working directory (or the home directory of the module map file that contained the 'extern module' directive importing this module map file if any) rather than the directory containing the module map file.
The home directory is where we look for files named in the module map file.
Definition at line 148 of file HeaderSearchOptions.h.
unsigned clang::HeaderSearchOptions::ModulesHashContent |
Definition at line 259 of file HeaderSearchOptions.h.
llvm::SmallSetVector<llvm::CachedHashString, 16> clang::HeaderSearchOptions::ModulesIgnoreMacros |
The set of macro names that should be ignored for the purposes of computing the module hash.
Definition at line 188 of file HeaderSearchOptions.h.
Referenced by GenerateHeaderSearchArgs(), clang::CompilerInvocation::getModuleHash(), makeCommonInvocationForModuleBuild(), and ParseHeaderSearchArgs().
unsigned clang::HeaderSearchOptions::ModulesIncludeVFSUsage |
Whether to include ivfsoverlay usage information in written AST files.
Definition at line 271 of file HeaderSearchOptions.h.
unsigned clang::HeaderSearchOptions::ModulesPruneNonAffectingModuleMaps |
Whether to prune non-affecting module map files from PCM files.
Definition at line 256 of file HeaderSearchOptions.h.
Referenced by makeCommonInvocationForModuleBuild().
unsigned clang::HeaderSearchOptions::ModulesSkipDiagnosticOptions |
Whether to entirely skip writing diagnostic options.
Primarily used to speed up deserialization during dependency scanning.
Definition at line 242 of file HeaderSearchOptions.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
unsigned clang::HeaderSearchOptions::ModulesSkipHeaderSearchPaths |
Whether to entirely skip writing header search paths.
Primarily used to speed up deserialization during dependency scanning.
Definition at line 247 of file HeaderSearchOptions.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
unsigned clang::HeaderSearchOptions::ModulesSkipPragmaDiagnosticMappings |
Whether to entirely skip writing pragma diagnostic mappings.
Primarily used to speed up deserialization during dependency scanning.
Definition at line 252 of file HeaderSearchOptions.h.
unsigned clang::HeaderSearchOptions::ModulesStrictContextHash |
Whether we should include all things that could impact the module in the hash.
This includes things like the full header search path, and enabled diagnostics.
Definition at line 267 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::ModulesValidateDiagnosticOptions |
Definition at line 237 of file HeaderSearchOptions.h.
Referenced by clang::DumpModuleInfoAction::ExecuteAction(), and clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::ModulesValidateOncePerBuildSession |
If true, skip verifying input files used by modules if the module was already verified during this build session (see BuildSessionTimestamp
).
Definition at line 217 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::clearImplicitModuleBuildOptions(), and clang::ASTReader::ReadAST().
unsigned clang::HeaderSearchOptions::ModulesValidateSystemHeaders |
Whether to validate system input files when a module is loaded.
Definition at line 221 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInstance::createASTReader(), and clang::CompilerInstance::createPCHExternalASTSource().
std::string clang::HeaderSearchOptions::ModuleUserBuildPath |
The directory used for a user build.
Definition at line 117 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::getModuleHash().
std::map<std::string, std::string, std::less<> > clang::HeaderSearchOptions::PrebuiltModuleFiles |
The mapping of module names to prebuilt module files.
Definition at line 120 of file HeaderSearchOptions.h.
Referenced by GenerateHeaderSearchArgs(), ParseHeaderSearchArgs(), and selectModuleSource().
std::vector<std::string> clang::HeaderSearchOptions::PrebuiltModulePaths |
The directories used to load prebuilt module files.
Definition at line 123 of file HeaderSearchOptions.h.
Referenced by AddPrebuiltModulePath(), GenerateHeaderSearchArgs(), and selectModuleSource().
std::string clang::HeaderSearchOptions::ResourceDir |
The directory which holds the compiler resource files (builtin includes, etc.).
Definition at line 111 of file HeaderSearchOptions.h.
Referenced by clang::ApplyHeaderSearchOptions(), clang::CompilerInvocation::getModuleHash(), and clang::ASTUnit::LoadFromCompilerInvocationAction().
std::string clang::HeaderSearchOptions::Sysroot |
If non-empty, the directory to use as a "virtual system root" for include paths.
Definition at line 101 of file HeaderSearchOptions.h.
Referenced by clang::ApplyHeaderSearchOptions(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::CompilerInstance::createASTReader(), clang::VerifyPCHAction::ExecuteAction(), clang::Sema::getDarwinSDKInfoForAvailabilityChecking(), clang::CompilerInvocation::getModuleHash(), initTargetOptions(), and ParseHeaderSearchArgs().
std::vector<SystemHeaderPrefix> clang::HeaderSearchOptions::SystemHeaderPrefixes |
User-specified system header prefixes.
Definition at line 107 of file HeaderSearchOptions.h.
Referenced by AddSystemHeaderPrefix(), clang::ApplyHeaderSearchOptions(), GenerateHeaderSearchArgs(), and clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::UseBuiltinIncludes |
Include the compiler builtin includes.
Definition at line 195 of file HeaderSearchOptions.h.
Referenced by clang::ApplyHeaderSearchOptions(), and clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::UseDebugInfo |
Whether the module includes debug information (-gmodules).
Definition at line 234 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::UseLibcxx |
Use libc++ instead of the default libstdc++.
Definition at line 207 of file HeaderSearchOptions.h.
Referenced by GenerateHeaderSearchArgs(), clang::CompilerInvocation::getModuleHash(), and ParseHeaderSearchArgs().
std::vector<Entry> clang::HeaderSearchOptions::UserEntries |
User specified include entries.
Definition at line 104 of file HeaderSearchOptions.h.
Referenced by AddPath(), clang::ApplyHeaderSearchOptions(), GenerateHeaderSearchArgs(), clang::CompilerInvocation::getModuleHash(), initTargetOptions(), and optimizeHeaderSearchOpts().
unsigned clang::HeaderSearchOptions::UseStandardCXXIncludes |
Include the system standard C++ library include search directories.
Definition at line 203 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::UseStandardSystemIncludes |
Include the system standard include search directories.
Definition at line 199 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInvocation::getModuleHash().
unsigned clang::HeaderSearchOptions::ValidateASTInputFilesContent |
Definition at line 226 of file HeaderSearchOptions.h.
Referenced by clang::CompilerInstance::createASTReader(), and clang::CompilerInstance::createPCHExternalASTSource().
unsigned clang::HeaderSearchOptions::Verbose |
Whether header search information should be output as for -v.
Definition at line 211 of file HeaderSearchOptions.h.
Referenced by clang::ApplyHeaderSearchOptions().
std::vector<std::string> clang::HeaderSearchOptions::VFSOverlayFiles |
The set of user-provided virtual filesystem overlay files.
Definition at line 191 of file HeaderSearchOptions.h.
Referenced by AddVFSOverlayFile(), collectVFSEntries(), clang::createVFSFromCompilerInvocation(), GenerateHeaderSearchArgs(), clang::CompilerInvocation::getModuleHash(), and optimizeHeaderSearchOpts().