================
@@ -63,6 +60,23 @@ class DependencyScanningWorker {
       DiagnosticConsumer &DiagConsumer,
       IntrusiveRefCntPtr<llvm::vfs::FileSystem> OverlayFS = nullptr);
 
+  /// Drain-style by-name scanning over a single cc1 command line. Builds a
+  /// scanning session local to this call, then pulls module names from
+  /// \p getNextInput and delivers each module's dependencies to
+  /// \p deliverResult (std::nullopt on scan failure) until \p getNextInput
+  /// returns std::nullopt. Diagnostics flow to \p DiagConsumer.
+  /// \returns false if session setup failed, true otherwise.
+  bool computeDependenciesByNameWithDrain(
+      StringRef CWD, ArrayRef<std::string> CC1CommandLine,
+      IntrusiveRefCntPtr<llvm::vfs::FileSystem> OverlayFS,
+      DiagnosticConsumer &DiagConsumer,
+      dependencies::DependencyActionController &Controller,
+      const llvm::DenseSet<dependencies::ModuleID> &AlreadySeen,
+      llvm::function_ref<std::optional<std::string>()> getNextInput,
+      llvm::function_ref<void(StringRef,
+                              
std::optional<dependencies::TranslationUnitDeps>)>
----------------
jansvoboda11 wrote:

I still think this doesn't provide anything the current `DependencyConsumer` 
doesn't, plus it forces allocation of full `TranslationUnitDeps`, which some 
consumers might not want (i.e. they'd be happy to just deal with the 
intermediate data passed to individual `consume*()` functions).

Maybe there's an argument to be made that always handing out 
`TranslationUnitDeps` is a simpler model than the `DependencyConsumer` API, but 
I think at the worker level we should commit to one or the other and use it 
consistently throughout all of its APIs.

https://github.com/llvm/llvm-project/pull/206800
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to