|
clang 22.0.0git
|
Classes | |
| struct | CachedFileContents |
| Contents and directive tokens of a cached file entry. More... | |
| class | CachedFileSystemEntry |
| An in-memory representation of a file system entity that is of interest to the dependency scanning filesystem. More... | |
| class | CallbackActionController |
| A simple dependency action controller that uses a callback. More... | |
| struct | Command |
| A command-line tool invocation that is part of building a TU. More... | |
| class | CompilerInstanceWithContext |
| class | DependencyActionController |
| Dependency scanner callbacks that are used during scanning to influence the behaviour of the scan - for example, to customize the scanned invocations. More... | |
| class | DependencyConsumer |
| class | DependencyScanningAction |
| class | DependencyScanningFilesystemLocalCache |
| This class is a local cache, that caches the 'stat' and 'open' calls to the underlying real file system. More... | |
| class | DependencyScanningFilesystemSharedCache |
| This class is a shared cache, that caches the 'stat' and 'open' calls to the underlying real file system, and the scanned preprocessor directives of files. More... | |
| class | DependencyScanningService |
| The dependency scanning service contains shared configuration and state that is used by the individual dependency scanning workers. More... | |
| class | DependencyScanningWorker |
| An individual dependency scanning worker that is able to run on its own thread. More... | |
| class | DependencyScanningWorkerFilesystem |
| A virtual file system optimized for the dependency discovery. More... | |
| struct | DignosticsEngineWithDiagOpts |
| class | EntryRef |
| Reference to a CachedFileSystemEntry. More... | |
| class | FullDependencyConsumer |
| struct | ModuleCacheEntries |
| struct | ModuleCacheEntry |
| class | ModuleDepCollector |
Collects modular and non-modular dependencies of the main file by attaching ModuleDepCollectorPP to the preprocessor. More... | |
| class | ModuleDepCollectorPP |
| Callback that records textual includes and direct modular includes/imports during preprocessing. More... | |
| struct | ModuleDeps |
| struct | ModuleID |
| This is used to identify a specific module. More... | |
| struct | P1689ModuleInfo |
| P1689ModuleInfo - Represents the needed information of standard C++20 modules for P1689 format. More... | |
| class | PrebuiltModuleASTAttrs |
| struct | PrebuiltModuleDep |
| Modular dependency that has already been built prior to the dependency scan. More... | |
| struct | TextDiagnosticsPrinterWithOutput |
| struct | TranslationUnitDeps |
| The full dependencies and module graph for a specific input. More... | |
Typedefs | |
| using | DependencyDirectivesTy |
| using | CachedRealPath = llvm::ErrorOr<std::string> |
| using | ModuleDepsGraph = std::vector<clang::dependencies::ModuleDeps> |
| Graph of modular dependencies. | |
| using | LookupModuleOutputCallback |
| A callback to lookup module outputs for "-fmodule-file=", "-o" etc. | |
| using | PrebuiltModulesAttrsMap = llvm::StringMap<PrebuiltModuleASTAttrs> |
| Attributes loaded from AST files of prebuilt modules collected prior to ModuleDepCollector creation. | |
Enumerations | |
| enum class | ScanningMode { CanonicalPreprocessing , DependencyDirectivesScan } |
| The mode in which the dependency scanner will operate to find the dependencies. More... | |
| enum class | ScanningOutputFormat { Make , Full , P1689 } |
| The format that is output by the dependency scanner. More... | |
| enum class | ScanningOptimizations { None = 0 , HeaderSearch = 1 , SystemWarnings = (1 << 1) , VFS = (1 << 2) , Macros = (1 << 3) , IgnoreCWD = (1 << 4) , DSS_LAST_BITMASK_ENUM =(IgnoreCWD) , Default = All & (~IgnoreCWD) } |
| enum class | ModuleOutputKind { ModuleFile , DependencyFile , DependencyTargets , DiagnosticSerializationFile } |
| An output from a module compilation, such as the path of the module file. More... | |
Functions | |
| std::unique_ptr< DiagnosticOptions > | createDiagOptions (ArrayRef< std::string > CommandLine) |
| std::pair< std::unique_ptr< driver::Driver >, std::unique_ptr< driver::Compilation > > | buildCompilation (ArrayRef< std::string > ArgStrs, DiagnosticsEngine &Diags, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, llvm::BumpPtrAllocator &Alloc) |
| std::unique_ptr< CompilerInvocation > | createCompilerInvocation (ArrayRef< std::string > CommandLine, DiagnosticsEngine &Diags) |
| std::pair< IntrusiveRefCntPtr< llvm::vfs::FileSystem >, std::vector< std::string > > | initVFSForTUBufferScanning (IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS, ArrayRef< std::string > CommandLine, StringRef WorkingDirectory, llvm::MemoryBufferRef TUBuffer) |
| std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > | initVFSForByNameScanning (IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS, ArrayRef< std::string > CommandLine, StringRef WorkingDirectory, StringRef ModuleName) |
| bool | initializeScanCompilerInstance (CompilerInstance &ScanInstance, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, DiagnosticConsumer *DiagConsumer, DependencyScanningService &Service, IntrusiveRefCntPtr< DependencyScanningWorkerFilesystem > DepFS) |
| SmallVector< StringRef > | getInitialStableDirs (const CompilerInstance &ScanInstance) |
| std::optional< PrebuiltModulesAttrsMap > | computePrebuiltModulesASTMap (CompilerInstance &ScanInstance, SmallVector< StringRef > &StableDirs) |
| std::unique_ptr< DependencyOutputOptions > | takeAndUpdateDependencyOutputOptionsFrom (CompilerInstance &ScanInstance) |
| std::shared_ptr< ModuleDepCollector > | initializeScanInstanceDependencyCollector (CompilerInstance &ScanInstance, std::unique_ptr< DependencyOutputOptions > DepOutputOpts, StringRef WorkingDirectory, DependencyConsumer &Consumer, DependencyScanningService &Service, CompilerInvocation &Inv, DependencyActionController &Controller, PrebuiltModulesAttrsMap PrebuiltModulesASTMap, llvm::SmallVector< StringRef > &StableDirs) |
| Create the dependency collector that will collect the produced dependencies. | |
| IntrusiveRefCntPtr< ModuleCache > | makeInProcessModuleCache (ModuleCacheEntries &Entries) |
| void | resetBenignCodeGenOptions (frontend::ActionKind ProgramAction, const LangOptions &LangOpts, CodeGenOptions &CGOpts) |
| Resets codegen options that don't affect modules/PCH. | |
| bool | isPathInStableDir (const ArrayRef< StringRef > Directories, const StringRef Input) |
Determine if Input can be resolved within a stable directory. | |
| bool | areOptionsInStableDir (const ArrayRef< StringRef > Directories, const HeaderSearchOptions &HSOpts) |
| Determine if options collected from a module's compilation can safely be considered as stable. | |
| using clang::dependencies::CachedRealPath = llvm::ErrorOr<std::string> |
Definition at line 145 of file DependencyScanningFilesystem.h.
Definition at line 26 of file DependencyScanningFilesystem.h.
A callback to lookup module outputs for "-fmodule-file=", "-o" etc.
Definition at line 133 of file DependencyScanningUtils.h.
| using clang::dependencies::ModuleDepsGraph = std::vector<clang::dependencies::ModuleDeps> |
Graph of modular dependencies.
Definition at line 24 of file DependencyScanningUtils.h.
| using clang::dependencies::PrebuiltModulesAttrsMap = llvm::StringMap<PrebuiltModuleASTAttrs> |
Attributes loaded from AST files of prebuilt modules collected prior to ModuleDepCollector creation.
Definition at line 51 of file ModuleDepCollector.h.
|
strong |
An output from a module compilation, such as the path of the module file.
Definition at line 139 of file ModuleDepCollector.h.
|
strong |
The mode in which the dependency scanner will operate to find the dependencies.
| Enumerator | |
|---|---|
| CanonicalPreprocessing | This mode is used to compute the dependencies by running the preprocessor over the source files. |
| DependencyDirectivesScan | This mode is used to compute the dependencies by running the preprocessor with special kind of lexing after scanning header and source files to get the minimum necessary preprocessor directives for evaluating includes. |
Definition at line 22 of file DependencyScanningService.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| HeaderSearch | Remove unused header search paths including header maps. |
| SystemWarnings | Remove warnings from system modules. |
| VFS | Remove unused -ivfsoverlay arguments. |
| Macros | Canonicalize -D and -U options. |
| IgnoreCWD | Ignore the compiler's working directory if it is safe. |
| DSS_LAST_BITMASK_ENUM | |
| Default | |
Definition at line 52 of file DependencyScanningService.h.
|
strong |
The format that is output by the dependency scanner.
| Enumerator | |
|---|---|
| Make | This is the Makefile compatible dep format. This will include all of the deps necessary for an implicit modules build, but won't include any intermodule dependency information. |
| Full | This outputs the full clang module dependency graph suitable for use for explicitly building modules. |
| P1689 | This outputs the dependency graph for standard c++ modules in P1689R5 format. |
Definition at line 34 of file DependencyScanningService.h.
| bool clang::dependencies::areOptionsInStableDir | ( | const ArrayRef< StringRef > | Directories, |
| const HeaderSearchOptions & | HSOpts ) |
Determine if options collected from a module's compilation can safely be considered as stable.
| Directories | Paths known to be in a stable location. e.g. Sysroot. |
| HSOpts | Header search options derived from the compiler invocation. |
Definition at line 227 of file ModuleDepCollector.cpp.
References isPathInStableDir(), clang::HeaderSearchOptions::ResourceDir, clang::HeaderSearchOptions::Sysroot, clang::HeaderSearchOptions::SystemHeaderPrefixes, and clang::HeaderSearchOptions::UserEntries.
| std::pair< std::unique_ptr< driver::Driver >, std::unique_ptr< driver::Compilation > > clang::dependencies::buildCompilation | ( | ArrayRef< std::string > | ArgStrs, |
| DiagnosticsEngine & | Diags, | ||
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | FS, | ||
| llvm::BumpPtrAllocator & | Alloc ) |
Definition at line 383 of file DependencyScannerImpl.cpp.
References clang::driver::expandResponseFiles(), clang::driver::getDriverMode(), clang::driver::IsClangCL(), and clang::DiagnosticsEngine::Report().
Referenced by forEachDriverJob(), and clang::dependencies::CompilerInstanceWithContext::initialize().
| std::optional< PrebuiltModulesAttrsMap > clang::dependencies::computePrebuiltModulesASTMap | ( | CompilerInstance & | ScanInstance, |
| llvm::SmallVector< StringRef > & | StableDirs ) |
Definition at line 574 of file DependencyScannerImpl.cpp.
References clang::CompilerInstance::getDiagnostics(), clang::CompilerInstance::getHeaderSearchOpts(), clang::CompilerInstance::getPreprocessorOpts(), clang::PreprocessorOptions::ImplicitPCHInclude, and clang::HeaderSearchOptions::PrebuiltModuleFiles.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize(), and clang::dependencies::DependencyScanningAction::runInvocation().
| std::unique_ptr< CompilerInvocation > clang::dependencies::createCompilerInvocation | ( | ArrayRef< std::string > | CommandLine, |
| DiagnosticsEngine & | Diags ) |
Definition at line 419 of file DependencyScannerImpl.cpp.
References clang::CompilerInvocation::CreateFromArgs().
Referenced by createAndRunToolInvocation().
| std::unique_ptr< DiagnosticOptions > clang::dependencies::createDiagOptions | ( | ArrayRef< std::string > | CommandLine | ) |
Definition at line 361 of file DependencyScannerImpl.cpp.
References clang::CreateAndPopulateDiagOpts().
Referenced by clang::dependencies::TextDiagnosticsPrinterWithOutput::TextDiagnosticsPrinterWithOutput().
| llvm::SmallVector< StringRef > clang::dependencies::getInitialStableDirs | ( | const CompilerInstance & | ScanInstance | ) |
Definition at line 562 of file DependencyScannerImpl.cpp.
References clang::CompilerInstance::getHeaderSearchOpts(), clang::HeaderSearchOptions::ResourceDir, and clang::HeaderSearchOptions::Sysroot.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize(), and clang::dependencies::DependencyScanningAction::runInvocation().
| bool clang::dependencies::initializeScanCompilerInstance | ( | CompilerInstance & | ScanInstance, |
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | FS, | ||
| DiagnosticConsumer * | DiagConsumer, | ||
| DependencyScanningService & | Service, | ||
| IntrusiveRefCntPtr< DependencyScanningWorkerFilesystem > | DepFS ) |
Definition at line 489 of file DependencyScannerImpl.cpp.
References clang::PreprocessorOptions::AllowPCHWithDifferentModulesCachePath, any(), clang::HeaderSearchOptions::BuildSessionTimestamp, clang::CompilerInstance::createDiagnostics(), clang::CompilerInstance::createFileManager(), clang::CompilerInstance::createSourceManager(), clang::CompilerInstance::createVirtualFileSystem(), DependencyDirectivesScan, clang::FrontendOptions::DisableFree, clang::FrontendOptions::GenerateGlobalModuleIndex, clang::FrontendOptions::GenReducedBMI, clang::dependencies::DependencyScanningService::getBuildSessionTimestamp(), clang::CompilerInstance::getDiagnosticOpts(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getFrontendOpts(), clang::CompilerInstance::getHeaderSearchOpts(), clang::dependencies::DependencyScanningService::getMode(), clang::dependencies::DependencyScanningService::getOptimizeArgs(), clang::CompilerInstance::getPreprocessorOpts(), clang::CompilerInstance::hasDiagnostics(), clang::HeaderSearchOptions::ModuleCachePath, clang::HeaderSearchOptions::ModuleFormat, clang::FrontendOptions::ModuleOutputPath, clang::PreprocessorOptions::ModulesCheckRelocated, clang::HeaderSearchOptions::ModulesForceValidateUserHeaders, clang::HeaderSearchOptions::ModulesIncludeVFSUsage, clang::HeaderSearchOptions::ModulesSerializeOnlyPreprocessor, clang::FrontendOptions::ModulesShareFileManager, clang::HeaderSearchOptions::ModulesSkipDiagnosticOptions, clang::HeaderSearchOptions::ModulesSkipHeaderSearchPaths, clang::HeaderSearchOptions::ModulesSkipPragmaDiagnosticMappings, clang::HeaderSearchOptions::ModulesStrictContextHash, clang::HeaderSearchOptions::ModulesValidateOncePerBuildSession, clang::normalizeModuleCachePath(), clang::ModuleLoader::setBuildingModule(), clang::CompilerInstance::setDependencyDirectivesGetter(), clang::FrontendOptions::UseGlobalModuleIndex, and VFS.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize(), and clang::dependencies::DependencyScanningAction::runInvocation().
| std::shared_ptr< ModuleDepCollector > clang::dependencies::initializeScanInstanceDependencyCollector | ( | CompilerInstance & | ScanInstance, |
| std::unique_ptr< DependencyOutputOptions > | DepOutputOpts, | ||
| StringRef | WorkingDirectory, | ||
| DependencyConsumer & | Consumer, | ||
| DependencyScanningService & | Service, | ||
| CompilerInvocation & | Inv, | ||
| DependencyActionController & | Controller, | ||
| PrebuiltModulesAttrsMap | PrebuiltModulesASTMap, | ||
| llvm::SmallVector< StringRef > & | StableDirs ) |
Create the dependency collector that will collect the produced dependencies.
May return the created ModuleDepCollector depending on the scanning format.
Definition at line 612 of file DependencyScannerImpl.cpp.
References clang::CompilerInstance::addDependencyCollector(), Full, clang::dependencies::DependencyScanningService::getFormat(), Make, and P1689.
Referenced by clang::dependencies::CompilerInstanceWithContext::computeDependencies(), and clang::dependencies::DependencyScanningAction::runInvocation().
| std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > clang::dependencies::initVFSForByNameScanning | ( | IntrusiveRefCntPtr< llvm::vfs::FileSystem > | BaseFS, |
| ArrayRef< std::string > | CommandLine, | ||
| StringRef | WorkingDirectory, | ||
| StringRef | ModuleName ) |
Definition at line 461 of file DependencyScannerImpl.cpp.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize().
| std::pair< IntrusiveRefCntPtr< llvm::vfs::FileSystem >, std::vector< std::string > > clang::dependencies::initVFSForTUBufferScanning | ( | IntrusiveRefCntPtr< llvm::vfs::FileSystem > | BaseFS, |
| ArrayRef< std::string > | CommandLine, | ||
| StringRef | WorkingDirectory, | ||
| llvm::MemoryBufferRef | TUBuffer ) |
Definition at line 434 of file DependencyScannerImpl.cpp.
Referenced by clang::dependencies::DependencyScanningWorker::computeDependencies().
| bool clang::dependencies::isPathInStableDir | ( | const ArrayRef< StringRef > | Directories, |
| const StringRef | Input ) |
Determine if Input can be resolved within a stable directory.
| Directories | Paths known to be in a stable location. e.g. Sysroot. |
| Input | Path to evaluate. |
Definition at line 205 of file ModuleDepCollector.cpp.
Referenced by areOptionsInStableDir().
| IntrusiveRefCntPtr< ModuleCache > clang::dependencies::makeInProcessModuleCache | ( | ModuleCacheEntries & | Entries | ) |
Definition at line 117 of file InProcessModuleCache.cpp.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize(), and clang::dependencies::DependencyScanningAction::runInvocation().
| void clang::dependencies::resetBenignCodeGenOptions | ( | frontend::ActionKind | ProgramAction, |
| const LangOptions & | LangOpts, | ||
| CodeGenOptions & | CGOpts ) |
Resets codegen options that don't affect modules/PCH.
Definition at line 185 of file ModuleDepCollector.cpp.
References clang::CodeGenOptions::CoverageCompilationDir, clang::CodeGenOptions::CoverageDataFile, clang::CodeGenOptions::CoverageNotesFile, clang::CodeGenOptions::DebugCompilationDir, clang::CodeGenOptions::DwarfDebugFlags, clang::frontend::GenerateModule, clang::frontend::GeneratePCH, clang::CodeGenOptions::MainFileName, clang::CodeGenOptions::ProfileInstrumentUsePath, clang::CodeGenOptions::ProfileRemappingFile, and clang::CodeGenOptions::SampleProfileFile.
Referenced by clang::dependencies::ModuleDepCollector::applyDiscoveredDependencies(), and makeCommonInvocationForModuleBuild().
| std::unique_ptr< DependencyOutputOptions > clang::dependencies::takeAndUpdateDependencyOutputOptionsFrom | ( | CompilerInstance & | ScanInstance | ) |
Definition at line 593 of file DependencyScannerImpl.cpp.
References clang::CompilerInvocation::getDependencyOutputOpts(), clang::CompilerInstance::getFrontendOpts(), clang::CompilerInstance::getInvocation(), clang::FrontendOptions::Inputs, and clang::FrontendOptions::OutputFile.
Referenced by clang::dependencies::CompilerInstanceWithContext::initialize(), and clang::dependencies::DependencyScanningAction::runInvocation().