Cache the value for absolute path in FileSpec.
authorGreg Clayton <gclayton@fb.com>
Fri, 22 Jul 2022 20:18:40 +0000 (13:18 -0700)
committerGreg Clayton <gclayton@fb.com>
Fri, 22 Jul 2022 21:04:52 +0000 (14:04 -0700)
commitdabe877248b85b34878e75d5510339325ee087d0
tree9fd55ec75af263db6a6762f3b0011bf87587a285
parent0bbce7a4c2d2bff622bdadd4323f93f5d90e6d24
Cache the value for absolute path in FileSpec.

Checking if a path is absolute can be expensive and currently the result is not cached in the FileSpec object. This patch adds caching and also code to clear the cache if the file is modified.

Differential Revision: https://reviews.llvm.org/D130396
lldb/include/lldb/Utility/FileSpec.h
lldb/source/Utility/FileSpec.cpp
lldb/unittests/Utility/FileSpecTest.cpp