[clang] Fix redirection behaviour for cached FileEntryRef
authorBen Langmuir <blangmuir@apple.com>
Fri, 5 Aug 2022 17:56:56 +0000 (10:56 -0700)
committerBen Langmuir <blangmuir@apple.com>
Fri, 5 Aug 2022 19:23:38 +0000 (12:23 -0700)
commitd038bb196c51dcf80cbe771f4229b4e227c6c5b6
treec218ad86c2d240401c3848f2ccbfd2372a77f2e1
parent3e0e5568a6a8c744d26f79a1e55360fe2655867c
[clang] Fix redirection behaviour for cached FileEntryRef

In 6a79e2ff1989b we changed Filemanager::getEntryRef() to return the
redirecting FileEntryRef instead of looking through the redirection.
This commit fixes the case when looking up a cached file path to also
return the redirecting FileEntryRef. This mainly affects the behaviour
of calling getNameAsRequested() on the resulting entry ref.

Differential Revision: https://reviews.llvm.org/D131273
clang/lib/Basic/FileManager.cpp
clang/unittests/Basic/FileManagerTest.cpp