[PATCH] D63579: [clang-scan-deps] print the dependencies to stdout and remove the need to use -MD options in the CDB

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 13:13:35 PDT 2019


arphaman added inline comments.


================
Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:32
 
+class DependencyCollectorFactory {
+public:
----------------
aganea wrote:
> Do you envision future uses for this factory?
Most likely, yes.

I don't want to lock-in into creating the dependency printer in the `PreprocessorOnlyTool`, as the eventual goal is to have it in a library, and allow clients to consume modular dependencies not only using `clang-scan-deps` tool itself, but using the C++ library directly (potentially through a libclang C interface as well). The printer should be in `clang-scan-deps` tool itself though, so it wouldn't be ideal to reference it from `PreprocessorOnlyTool` now.


================
Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:50
+        std::unique_ptr<DependencyOutputOptions> Opts) override {
+      std::unique_lock<std::mutex> LockGuard(SharedLock);
+      return std::make_shared<DependencyPrinter>(std::move(Opts), SharedLock,
----------------
aganea wrote:
> Do you need the blocking behavior here? You're simply passing the Lock by reference, but not using the stream that it protects.
Right, I don't need it here. removed in the updated patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63579/new/

https://reviews.llvm.org/D63579





More information about the cfe-commits mailing list