================
@@ -93,29 +93,39 @@ class DependencyScanningWorker {
~DependencyScanningWorker();
- /// Run the dependency scanning tool for a given clang driver command-line,
- /// and report the discovered dependencies to the provided consumer. If
- /// TUBuffer is not nullopt, it is used as TU input for the dependency
- /// scanning. Otherwise, the input should be included as part of the
- /// command-line.
+ /// Run the dependency scanning tool for the given driver job command-line,
+ /// and report the discovered dependencies to the provided consumer.
+ ///
+ /// OverlayFS should be based on the Worker's dependency scanning file-system
+ /// and can be used to provide any input specified on the command-line as
+ /// in-memory file. If no overlay file-system is provided, the Worker's
+ /// dependency scanning file-system is used instead.
///
/// \returns false if clang errors occurred (with diagnostics reported to
/// \c DiagConsumer), true otherwise.
bool computeDependencies(
StringRef WorkingDirectory, ArrayRef<std::string> CommandLine,
DependencyConsumer &DepConsumer, DependencyActionController &Controller,
DiagnosticConsumer &DiagConsumer,
- std::optional<llvm::MemoryBufferRef> TUBuffer = std::nullopt);
+ llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS =
+ nullptr);
- /// Run the dependency scanning tool for a given clang driver command-line
- /// for a specific translation unit via file system or memory buffer.
+ /// Run the dependency scanning tool for all given driver job command-lines,
+ /// and report the discovered dependencies to the provided consumer.
///
- /// \returns A \c StringError with the diagnostic output if clang errors
- /// occurred, success otherwise.
- llvm::Error computeDependencies(
- StringRef WorkingDirectory, ArrayRef<std::string> CommandLine,
- DependencyConsumer &Consumer, DependencyActionController &Controller,
- std::optional<llvm::MemoryBufferRef> TUBuffer = std::nullopt);
+ /// OverlayFS should be based on the Worker's dependency scanning file-system
+ /// and can be used to provide any input specified on the command-line as
+ /// in-memory file. If no overlay file-system is provided, the Worker's
+ /// dependency scanning file-system is used instead.
+ ///
+ /// \returns false if clang errors occurred (with diagnostics reported to
+ /// \c Diags), true otherwise.
+ bool computeDependencies(
+ StringRef WorkingDirectory, ArrayRef<ArrayRef<std::string>> CommandLines,
+ DependencyConsumer &DepConsumer, DependencyActionController &Controller,
+ DiagnosticsEngine &Diags,
----------------
jansvoboda11 wrote:
I see, this makes sense to me, thanks. I guess it's a bit different to how real
driver/frontend does things, where I think the driver uses a separate
`DiagnosticsEngine` from each frontend invocation, but I think in practice
their configuration ends up being equivalent.
https://github.com/llvm/llvm-project/pull/172347
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits