9#ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNER_H
10#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNER_H
38 std::optional<StringRef> ModuleName = std::nullopt)
39 : Service(Service), WorkingDirectory(WorkingDirectory),
40 Consumer(Consumer), Controller(Controller), DepFS(
std::move(DepFS)) {}
41 bool runInvocation(std::unique_ptr<CompilerInvocation> Invocation,
43 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
53 std::vector<std::string>
Result;
54 std::swap(
Result, LastCC1Arguments);
61 MDC->applyDiscoveredDependencies(CI);
62 LastCC1Arguments = CI.getCC1CommandLine();
65 DependencyScanningService &Service;
66 StringRef WorkingDirectory;
67 DependencyConsumer &Consumer;
68 DependencyActionController &Controller;
70 std::optional<CompilerInstance> ScanInstanceStorage;
71 std::shared_ptr<ModuleDepCollector> MDC;
72 std::vector<std::string> LastCC1Arguments;
74 bool DiagConsumerFinished =
false;
78std::unique_ptr<DiagnosticOptions>
106std::pair<std::unique_ptr<driver::Driver>, std::unique_ptr<driver::Compilation>>
109 llvm::BumpPtrAllocator &Alloc);
111std::unique_ptr<CompilerInvocation>
115std::pair<IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::vector<std::string>>
118 StringRef WorkingDirectory,
119 llvm::MemoryBufferRef TUBuffer);
121std::pair<IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>,
122 std::vector<std::string>>
125 StringRef WorkingDirectory, StringRef ModuleName);
136std::optional<PrebuiltModulesAttrsMap>
140std::unique_ptr<DependencyOutputOptions>
148 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
149 StringRef WorkingDirectory, DependencyConsumer &Consumer,
151 DependencyActionController &Controller,
159 std::vector<std::string> CommandLine;
165 std::unique_ptr<TextDiagnosticsPrinterWithOutput> DiagPrinterWithOS;
169 std::unique_ptr<DignosticsEngineWithDiagOpts> DiagEngineWithCmdAndOpts;
174 llvm::BumpPtrAllocator Alloc;
175 std::unique_ptr<clang::driver::Driver> Driver;
176 std::unique_ptr<clang::driver::Compilation> Compilation;
177 std::unique_ptr<CompilerInvocation> OriginalInvocation;
180 std::unique_ptr<DependencyOutputOptions> OutputOpts;
187 std::unique_ptr<CompilerInstance> CIPtr;
190 int32_t SrcLocOffset = 0;
194 const std::vector<std::string> &CMD)
195 : Worker(Worker), CWD(CWD), CommandLine(CMD) {};
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.
bool initialize(DiagnosticConsumer *DC)
llvm::Error handleReturnStatus(bool Success)
bool computeDependencies(StringRef ModuleName, DependencyConsumer &Consumer, DependencyActionController &Controller)
CompilerInstanceWithContext(DependencyScanningWorker &Worker, StringRef CWD, const std::vector< std::string > &CMD)
The JSON file list parser is used to communicate input to InstallAPI.
@ Success
Annotation was successful.
@ Result
The result type of a method or function.
std::string DiagnosticOutput
TextDiagnosticPrinter DiagPrinter
std::unique_ptr< DiagnosticOptions > DiagOpts
TextDiagnosticsPrinterWithOutput(ArrayRef< std::string > CommandLine)
llvm::raw_string_ostream DiagnosticsOS