9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNERIMPL_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNERIMPL_H
17#include "llvm/Support/VirtualFileSystem.h"
36 : Service(Service), WorkingDirectory(WorkingDirectory),
37 Consumer(Consumer), Controller(Controller), DepFS(
std::move(DepFS)) {}
39 std::unique_ptr<CompilerInvocation> Invocation,
41 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
48 StringRef WorkingDirectory;
52 std::optional<CompilerInstance> ScanInstanceStorage;
53 std::shared_ptr<ModuleDepCollector> MDC;
58std::unique_ptr<DiagnosticOptions>
86std::unique_ptr<CompilerInvocation>
94std::shared_ptr<CompilerInvocation>
96 const DependencyScanningService &Service,
97 DependencyActionController &Controller);
101std::unique_ptr<DependencyOutputOptions>
113std::optional<PrebuiltModulesAttrsMap>
122 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
124 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)
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::unique_ptr< DiagnosticOptions > createDiagOptions(ArrayRef< std::string > CommandLine)
std::shared_ptr< ModuleDepCollector > initializeScanInstanceDependencyCollector(CompilerInstance &ScanInstance, std::unique_ptr< DependencyOutputOptions > DepOutputOpts, DependencyScanningService &Service, CompilerInvocation &Inv, DependencyActionController &Controller, PrebuiltModulesAttrsMap PrebuiltModulesASTMap, SmallVector< StringRef > &StableDirs)
Create the dependency collector that will collect the produced dependencies.
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