class ModuleDepCollector
Declaration
class ModuleDepCollector : public DependencyCollector { /* full declaration omitted */ };
Description
Collects modular and non-modular dependencies of the main file by attaching\c ModuleDepCollectorPP to the preprocessor.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:199
Inherits from: DependencyCollector
Member Variables
- private clang::CompilerInstance& ScanInstance
- The compiler instance for scanning the current translation unit.
- private clang::tooling::dependencies::DependencyConsumer& Consumer
- The consumer of collected dependency information.
- private std::string MainFile
- Path to the main source file.
- private std::string ContextHash
- Hash identifying the compilation conditions of the current TU.
- private std::vector<std::string> FileDeps
- Non-modular file dependencies. This includes the main source file and textually included header files.
- private llvm::MapVector<const Module*, std::unique_ptr<ModuleDeps>> ModularDeps
- Direct and transitive modular dependencies of the main source file.
- private std::unique_ptr<DependencyOutputOptions> Opts
- Options that control the dependency output generation.
- private clang::CompilerInvocation OriginalInvocation
- The original Clang invocation passed to dependency scanner.
- private bool OptimizeArgs
- Whether to optimize the modules' command-line arguments.
Method Overview
- public ModuleDepCollector(std::unique_ptr<DependencyOutputOptions> Opts, clang::CompilerInstance & ScanInstance, clang::tooling::dependencies::DependencyConsumer & C, clang::CompilerInvocation && OriginalCI, bool OptimizeArgs)
- public void attachToASTReader(clang::ASTReader & R)
- public void attachToPreprocessor(clang::Preprocessor & PP)
- private bool isPrebuiltModule(const clang::Module * M)
- private clang::CompilerInvocation makeInvocationForModuleBuildWithoutPaths(const clang::tooling::dependencies::ModuleDeps & Deps, llvm::function_ref<void (CompilerInvocation &)> Optimize) const
Inherited from DependencyCollector:
- protected addDependency
- public attachToASTReader
- public attachToPreprocessor
- public finishedMainFile
- public getDependencies
- public maybeAddDependency
- public needSystemDependencies
- public sawDependency
Methods
¶ModuleDepCollector(
std::unique_ptr<DependencyOutputOptions> Opts,
clang::CompilerInstance& ScanInstance,
clang::tooling::dependencies::
DependencyConsumer& C,
clang::CompilerInvocation&& OriginalCI,
bool OptimizeArgs)
ModuleDepCollector(
std::unique_ptr<DependencyOutputOptions> Opts,
clang::CompilerInstance& ScanInstance,
clang::tooling::dependencies::
DependencyConsumer& C,
clang::CompilerInvocation&& OriginalCI,
bool OptimizeArgs)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:201
Parameters
- std::unique_ptr<DependencyOutputOptions> Opts
- clang::CompilerInstance& ScanInstance
- clang::tooling::dependencies::DependencyConsumer& C
- clang::CompilerInvocation&& OriginalCI
- bool OptimizeArgs
¶void attachToASTReader(clang::ASTReader& R)
void attachToASTReader(clang::ASTReader& R)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:206
Parameters
¶void attachToPreprocessor(clang::Preprocessor& PP)
void attachToPreprocessor(clang::Preprocessor& PP)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:205
Parameters
¶bool isPrebuiltModule(const clang::Module* M)
bool isPrebuiltModule(const clang::Module* M)
Description
Checks whether the module is known as being prebuilt.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:232
Parameters
- const clang::Module* M
¶clang::CompilerInvocation
makeInvocationForModuleBuildWithoutPaths(
const clang::tooling::dependencies::
ModuleDeps& Deps,
llvm::function_ref<void(CompilerInvocation&)>
Optimize) const
clang::CompilerInvocation
makeInvocationForModuleBuildWithoutPaths(
const clang::tooling::dependencies::
ModuleDeps& Deps,
llvm::function_ref<void(CompilerInvocation&)>
Optimize) const
Description
Constructs a CompilerInvocation that can be used to build the given module, excluding paths to discovered modular dependencies that are yet to be built.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:237
Parameters
- const clang::tooling::dependencies::ModuleDeps& Deps
- llvm::function_ref<void(CompilerInvocation&)> Optimize