[all-commits] [llvm/llvm-project] 05ec16: [clang][deps] Avoid leaking modulemap paths across...

Ben Langmuir via All-commits all-commits at lists.llvm.org
Tue Nov 15 14:04:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 05ec16d90deb747414c8534f98617d25d90bb714
      https://github.com/llvm/llvm-project/commit/05ec16d90deb747414c8534f98617d25d90bb714
  Author: Ben Langmuir <blangmuir at apple.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M clang/include/clang/Serialization/ASTReader.h
    M clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
    M clang/lib/Frontend/FrontendAction.cpp
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
    A clang/test/ClangScanDeps/modules-symlink-dir-from-module.c

  Log Message:
  -----------
  [clang][deps] Avoid leaking modulemap paths across unrelated imports

Use a FileEntryRef when retrieving modulemap paths in the scanner so
that we use a path compatible with the original module import, rather
than a FileEntry which can allow unrelated modules to leak paths into
how we build a module due to FileManager mutating the path.

Note: the current change prevents an "unrelated" path, but does not
change how VFS mapped paths are handled (which would be calling
getNameAsRequested) nor canonicalize the path.

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




More information about the All-commits mailing list