[lldb] Avoid FileSystem::Resolve for cached files in the SourceManager
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 26 Jun 2023 17:45:23 +0000 (10:45 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 27 Jun 2023 21:19:02 +0000 (14:19 -0700)
commitca7914564e676fe52fa80049d9c6932653522424
tree5a74a5584387d140afdc66f6f3265411960669d8
parent3a4e9f7ae50980ce8f103cbe86d24c574c8c6cac
[lldb] Avoid FileSystem::Resolve for cached files in the SourceManager

Currently, source files are cached by their resolved path. This means
that before we can query the cache, we potentially have to resolve the
path, which can be slow. This patch avoids the call to FileSystem::Resolve
by caching both the resolved and unresolved path. We now only resolve
the path once when we create and cache a new file.

rdar://110787562

Differential revision: https://reviews.llvm.org/D153726
lldb/include/lldb/Core/SourceManager.h
lldb/include/lldb/Host/FileSystem.h
lldb/source/Core/SourceManager.cpp
lldb/source/Host/common/FileSystem.cpp
lldb/unittests/Core/SourceManagerTest.cpp