[all-commits] [llvm/llvm-project] 462955: [clang][deps] Handle modular dependencies present ...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Jun 14 03:01:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4629554f0b664c94ada7c44fe40855d7a9a39820
      https://github.com/llvm/llvm-project/commit/4629554f0b664c94ada7c44fe40855d7a9a39820
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-06-14 (Mon, 14 Jun 2021)

  Changed paths:
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
    M clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
    M clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
    M clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
    M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
    A clang/test/ClangScanDeps/Inputs/modules-pch/cdb_pch.json
    A clang/test/ClangScanDeps/Inputs/modules-pch/cdb_tu_with_common.json
    A clang/test/ClangScanDeps/Inputs/modules-pch/mod_common_1.h
    A clang/test/ClangScanDeps/Inputs/modules-pch/mod_common_2.h
    A clang/test/ClangScanDeps/Inputs/modules-pch/mod_pch.h
    A clang/test/ClangScanDeps/Inputs/modules-pch/mod_tu_with_common.h
    M clang/test/ClangScanDeps/Inputs/modules-pch/module.modulemap
    M clang/test/ClangScanDeps/Inputs/modules-pch/pch.h
    A clang/test/ClangScanDeps/Inputs/modules-pch/tu_with_common.c
    M clang/test/ClangScanDeps/modules-pch.c

  Log Message:
  -----------
  [clang][deps] Handle modular dependencies present in PCH

When a translation unit uses a PCH and imports the same modules as the PCH, we'd prefer to resolve to those modules instead of inventing new modules and reporting them as modular dependencies. Since the PCH modules have already been built nudge the compiler to reuse them when deciding whether to build a new module and don't report them as regular modular dependencies.

Depends on D103524 & D103802.

Reviewed By: dexonsmith

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




More information about the All-commits mailing list