[all-commits] [llvm/llvm-project] 935a07: [clang][deps][lex] Avoid canonicalization of remap...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Dec 1 20:00:07 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 935a07ed21434825a96eb6d3acd2163edd0abe88
      https://github.com/llvm/llvm-project/commit/935a07ed21434825a96eb6d3acd2163edd0abe88
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M clang/lib/Lex/ModuleMap.cpp
    A clang/test/ClangScanDeps/modules-symlink-dir-vfs.c

  Log Message:
  -----------
  [clang][deps][lex] Avoid canonicalization of remapped framework directories

In D134923, the scanner introduced canonicalization of framework directories when reporting module map paths in order to increase module sharing. However, if we canonicalize framework directory that plays a role in a VFS remapping, and later try to use that module map to build the module, header lookup can fail. This happens when the module headers are remapped using the original framework path.

This patch fixes that. The implementation relies on the fact that the chain of directories in VFS remapping are assigned `DirectoryEntry` objects distinct from their on-disk counterparts. If we detect that case, we avoid the canonicalization.

Reviewed By: benlangmuir

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




More information about the All-commits mailing list