9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNERIMPL_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNERIMPL_H
19#include "llvm/Support/VirtualFileSystem.h"
38 std::optional<StringRef> ModuleName = std::nullopt)
39 : Service(Service), WorkingDirectory(WorkingDirectory),
40 Consumer(Consumer), Controller(Controller), DepFS(
std::move(DepFS)) {}
42 std::unique_ptr<CompilerInvocation> Invocation,
44 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
51 StringRef WorkingDirectory;
55 std::optional<CompilerInstance> ScanInstanceStorage;
56 std::shared_ptr<ModuleDepCollector> MDC;
61std::unique_ptr<DiagnosticOptions>
89std::unique_ptr<CompilerInvocation>
97std::shared_ptr<CompilerInvocation>
99 const DependencyScanningService &Service,
100 DependencyActionController &Controller);
104std::unique_ptr<DependencyOutputOptions>
116std::optional<PrebuiltModulesAttrsMap>
125 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
126 StringRef WorkingDirectory, DependencyConsumer &Consumer,
128 DependencyActionController &Controller,
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Helper class for holding the data necessary to invoke the compiler.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
Concrete class used by the front-end to report problems and issues.
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
Dependency scanner callbacks that are used during scanning to influence the behaviour of the scan - f...
DependencyScanningAction(DependencyScanningService &Service, StringRef WorkingDirectory, DependencyConsumer &Consumer, DependencyActionController &Controller, IntrusiveRefCntPtr< DependencyScanningWorkerFilesystem > DepFS, std::optional< StringRef > ModuleName=std::nullopt)
bool runInvocation(std::string Executable, std::unique_ptr< CompilerInvocation > Invocation, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagConsumer)
The dependency scanning service contains shared configuration and state that is used by the individua...
A virtual file system optimized for the dependency discovery.
An individual dependency scanning worker that is able to run on its own thread.
SmallVector< StringRef > getInitialStableDirs(const CompilerInstance &ScanInstance)
std::shared_ptr< CompilerInvocation > createScanCompilerInvocation(const CompilerInvocation &Invocation, const DependencyScanningService &Service, DependencyActionController &Controller)
Creates a CompilerInvocation suitable for the dependency scanner.
void initializeScanCompilerInstance(CompilerInstance &ScanInstance, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, DiagnosticConsumer *DiagConsumer, DependencyScanningService &Service, IntrusiveRefCntPtr< DependencyScanningWorkerFilesystem > DepFS)
llvm::StringMap< PrebuiltModuleASTAttrs > PrebuiltModulesAttrsMap
Attributes loaded from AST files of prebuilt modules collected prior to ModuleDepCollector creation.
std::unique_ptr< CompilerInvocation > createCompilerInvocation(ArrayRef< std::string > CommandLine, DiagnosticsEngine &Diags)
void canonicalizeDefines(PreprocessorOptions &PPOpts)
Canonicalizes command-line macro defines (e.g. removing "-DX -UX").
std::unique_ptr< DependencyOutputOptions > createDependencyOutputOptions(const CompilerInvocation &Invocation)
Creates dependency output options to be reported to the dependency consumer, deducing missing informa...
std::optional< PrebuiltModulesAttrsMap > computePrebuiltModulesASTMap(CompilerInstance &ScanInstance, SmallVector< StringRef > &StableDirs)
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.
std::unique_ptr< DiagnosticOptions > createDiagOptions(ArrayRef< std::string > CommandLine)
The JSON file list parser is used to communicate input to InstallAPI.
IntrusiveRefCntPtr< DiagnosticsEngine > DiagEngine
DiagnosticsEngineWithDiagOpts(ArrayRef< std::string > CommandLine, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, DiagnosticConsumer &DC)
std::unique_ptr< DiagnosticOptions > DiagOpts
TextDiagnosticPrinter DiagPrinter
std::unique_ptr< DiagnosticOptions > DiagOpts
std::string DiagnosticOutput
TextDiagnosticsPrinterWithOutput(ArrayRef< std::string > CommandLine)
llvm::raw_string_ostream DiagnosticsOS