[all-commits] [llvm/llvm-project] da1a16: [clang][modules] Preserve the module map that allo...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Oct 28 11:24:49 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da1a16ae10177494c7cae929bec987e90a160403
      https://github.com/llvm/llvm-project/commit/da1a16ae10177494c7cae929bec987e90a160403
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M clang/include/clang/Serialization/ASTBitCodes.h
    M clang/include/clang/Serialization/ASTReader.h
    M clang/lib/Frontend/FrontendAction.cpp
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
    M clang/test/ClangScanDeps/link-libraries.c

  Log Message:
  -----------
  [clang][modules] Preserve the module map that allowed inferring (#113389)

With inferred modules, the dependency scanner takes care to replace the
fake "__inferred_module.map" path with the file that allowed the module
to be inferred. However, this only worked when such a module was
imported directly in the TU. Whenever such module got loaded
transitively, the scanner would fail to perform the replacement. This is
caused by the fact that PCM files are lossy and drop this information.

This patch makes sure that PCMs include this file for each submodule (in
the `SUBMODULE_DEFINITION` record), fixes one existing test with an
incorrect assertion, and does a little drive-by refactoring of
`ModuleMap`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list