[all-commits] [llvm/llvm-project] 32219c: [clang][deps] Simplify function discovering .pcm a...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Apr 19 03:11:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 32219c8c44787c79edbd68962b554860338651e8
      https://github.com/llvm/llvm-project/commit/32219c8c44787c79edbd68962b554860338651e8
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
    M clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
    M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
    M clang/test/ClangScanDeps/modules-full.cpp

  Log Message:
  -----------
  [clang][deps] Simplify function discovering .pcm and .modulemap files

This patch simplifies (and renames) the `appendCommonModuleArguments` function.

It no longer tries to construct the command line for explicitly building modules. Instead, it only performs the DFS traversal of modular dependencies and queries the callbacks to collect paths to `.pcm` and `.modulemap` files.

This makes it more flexible and usable in two contexts:

* Generating additional command line arguments for the main TU in modular build. The `std::vector<std::string>` output parameters can be used to manually generate appropriate command line flags.
* Generate full command line for a module. The output parameters can be the corresponding parts of `CompilerInvocation`. (In a follow-up patch.)

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D100531




More information about the All-commits mailing list