|
clang 23.0.0git
|
Collects modular and non-modular dependencies of the main file by attaching ModuleDepCollectorPP to the preprocessor.
More...
#include "clang/DependencyScanning/ModuleDepCollector.h"
Classes | |
| class | ModuleDepCollectorPP |
| Callback that records textual includes and direct modular includes/imports during preprocessing. More... | |
Public Member Functions | |
| ModuleDepCollector (DependencyScanningService &Service, std::unique_ptr< DependencyOutputOptions > Opts, CompilerInstance &ScanInstance, DependencyActionController &Controller, CompilerInvocation OriginalCI, const PrebuiltModulesAttrsMap PrebuiltModulesASTMap, const ArrayRef< StringRef > StableDirs) | |
| void | run (DependencyConsumer &Consumer) |
Processes the accumulated dependency information and reports it to the Consumer. | |
| void | attachToPreprocessor (Preprocessor &PP) override |
| void | attachToASTReader (ASTReader &R) override |
| PPCallbacks * | getPPCallbacks () |
| void | applyDiscoveredDependencies (CompilerInvocation &CI) |
| Apply any changes implied by the discovered dependencies to the given invocation, (e.g. | |
| Public Member Functions inherited from clang::DependencyCollector | |
| virtual | ~DependencyCollector () |
| ArrayRef< std::string > | getDependencies () const |
| virtual bool | sawDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsDirectModuleImport, bool IsMissing) |
| Called when a new file is seen. | |
| virtual void | finishedMainFile (DiagnosticsEngine &Diags) |
| Called when the end of the main file is reached. | |
| virtual bool | needSystemDependencies () |
| Return true if system files should be passed to sawDependency(). | |
| virtual void | maybeAddDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsDirectModuleImport, bool IsMissing) |
Add a dependency Filename if it has not been seen before and sawDependency() returns true. | |
Additional Inherited Members | |
| Protected Member Functions inherited from clang::DependencyCollector | |
| bool | addDependency (StringRef Filename) |
| Return true if the filename was added to the list of dependencies, false otherwise. | |
Collects modular and non-modular dependencies of the main file by attaching ModuleDepCollectorPP to the preprocessor.
Definition at line 81 of file ModuleDepCollector.h.
| ModuleDepCollector::ModuleDepCollector | ( | DependencyScanningService & | Service, |
| std::unique_ptr< DependencyOutputOptions > | Opts, | ||
| CompilerInstance & | ScanInstance, | ||
| DependencyActionController & | Controller, | ||
| CompilerInvocation | OriginalCI, | ||
| const PrebuiltModulesAttrsMap | PrebuiltModulesASTMap, | ||
| const ArrayRef< StringRef > | StableDirs ) |
Definition at line 856 of file ModuleDepCollector.cpp.
References makeCommonInvocationForModuleBuild().
Referenced by clang::dependencies::ModuleDepCollector::ModuleDepCollectorPP::ModuleDepCollectorPP().
| void ModuleDepCollector::applyDiscoveredDependencies | ( | CompilerInvocation & | CI | ) |
Apply any changes implied by the discovered dependencies to the given invocation, (e.g.
disable implicit modules, add explicit module paths).
Definition at line 431 of file ModuleDepCollector.cpp.
References clang::CompilerInvocation::clearImplicitModuleBuildOptions(), clang::CompilerInvocation::getCodeGenOpts(), clang::Preprocessor::getCurrentModuleImplementation(), clang::CompilerInvocation::getDependencyOutputOpts(), clang::CompilerInvocation::getFrontendOpts(), clang::Preprocessor::getHeaderSearchInfo(), clang::CompilerInvocation::getLangOpts(), clang::HeaderSearch::getModuleMap(), clang::ModuleMap::getModuleMapFileForUniquing(), clang::DependencyOutputOptions::IncludeModuleFiles, clang::FrontendOptions::Inputs, clang::MFDK_Direct, clang::FrontendOptions::ModuleFiles, clang::FrontendOptions::ModuleMapFiles, needsModules(), clang::FrontendOptions::ProgramAction, and clang::dependencies::resetBenignCodeGenOptions().
|
overridevirtual |
Reimplemented from clang::DependencyCollector.
Definition at line 875 of file ModuleDepCollector.cpp.
|
overridevirtual |
Reimplemented from clang::DependencyCollector.
Definition at line 869 of file ModuleDepCollector.cpp.
References clang::Preprocessor::addPPCallbacks().
|
inline |
Definition at line 98 of file ModuleDepCollector.h.
| void ModuleDepCollector::run | ( | DependencyConsumer & | Consumer | ) |
Processes the accumulated dependency information and reports it to the Consumer.
Definition at line 610 of file ModuleDepCollector.cpp.
References clang::dependencies::DependencyConsumer::handleContextHash(), clang::dependencies::DependencyConsumer::handleDependencyOutputOpts(), clang::dependencies::DependencyConsumer::handleDirectModuleDependency(), clang::dependencies::DependencyConsumer::handleFileDependency(), clang::dependencies::DependencyConsumer::handleModuleDependency(), clang::dependencies::DependencyConsumer::handlePrebuiltModuleDependency(), clang::dependencies::DependencyConsumer::handleProvidedAndRequiredStdCXXModules(), clang::dependencies::DependencyConsumer::handleVisibleModule(), clang::dependencies::P1689ModuleInfo::IsStdCXXModuleInterface, clang::dependencies::P1689ModuleInfo::ModuleName, clang::dependencies::P1689ModuleInfo::NamedCXXModule, clang::dependencies::P1689ModuleInfo::Type, and clang::dependencies::VFS.