[DependencyScanningFilesystem] Make sure the local/shared cache filename lookups...
authorArgyrios Kyrtzidis <kyrtzidis@apple.com>
Wed, 20 Sep 2023 01:18:23 +0000 (18:18 -0700)
committerTobias Hieta <tobias@hieta.se>
Fri, 29 Sep 2023 06:24:09 +0000 (08:24 +0200)
commite718f3240a57454ae14022cf3ccaba5245786a53
tree1c81da480449891a61a4161dbfcaf0cdfaacd108
parent45066b9fbc7b84dfcf5363d01fadd3d42c049e7f
[DependencyScanningFilesystem] Make sure the local/shared cache filename lookups use only absolute paths (#66122)

Previously a relative path would be used as a key for cache lookup and
if the same relative path was used from another compiler invocation with
a different working directory then the first cache entry was erroneously
returned.

(cherry picked from commit 36b37c775c285bbff9b57630e7ea9d00b918cc91)
clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
clang/test/ClangScanDeps/relative-filenames.c [new file with mode: 0644]