[all-commits] [llvm/llvm-project] c68f24: [clang-scan-deps] ignore top-level module dependen...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Tue Jul 20 11:11:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c68f247275eed94a4f4b97ad53b4d599acfd181a
      https://github.com/llvm/llvm-project/commit/c68f247275eed94a4f4b97ad53b4d599acfd181a
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
    A clang/test/ClangScanDeps/Inputs/header3.h
    M clang/test/ClangScanDeps/Inputs/module.modulemap
    A clang/test/ClangScanDeps/Inputs/module_fmodule_name_cdb.json
    A clang/test/ClangScanDeps/modules-fmodule-name-no-module-built.m

  Log Message:
  -----------
  [clang-scan-deps] ignore top-level module dependencies that aren't actually imported

Whenever -fmodule-name=top_level_module name is parsed, and clang actually tries to
import top_level_module, the headers are imported textually and the module isn't actually
built. However, the dependency scanner could still record it as a potential dependency
if the module was reimported and thus recorded by the preprocessor callbacks.
This change avoids collecting this kind of module as a dependency by verifying that we don't
collect top level modules without actual PCM files.

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




More information about the All-commits mailing list