================
@@ -453,8 +583,18 @@ bool DependencyScanningAction::runInvocation(
             ScanInstance.getPreprocessorOpts().ImplicitPCHInclude, 
ScanInstance,
             ScanInstance.getHeaderSearchOpts().PrebuiltModuleFiles,
             PrebuiltModulesASTMap, ScanInstance.getDiagnostics(), StableDirs))
-      return false;
+      return {};
 
+  return PrebuiltModulesASTMap;
+}
+
+void clang::tooling::dependencies::initializeModuleDepCollector(
----------------
jansvoboda11 wrote:

Looking at the implementation, I don't think this is the right level of 
abstraction. This doesn't always initialize `MDC`, and it does a bunch of other 
things too. Let's re-think the split here. Maybe we can do something like this:

```c++
std::unique_ptr<DependencyOutputOptions>
extractDependencyOutputOpts(CompilerInvocation &Invocation);

void initializeDependencyCollector(CompilerInstance &Instance,
                                   std::unique_ptr<DependencyOutputOptions>, 
...);

auto DepOutOpts = extractDependencyOutputOpts(ScanInstance.getInvocation());
initializeDependencyCollector(ScanInstance, std::move(DepOutOpts), ...);
```

What do you think?

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

Reply via email to