This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Avoid FileSystem::Resolve for cached files in the SourceManager
ClosedPublic

Authored by JDevlieghere on Jun 25 2023, 12:11 PM.

Details

Summary

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.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jun 25 2023, 12:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2023, 12:11 PM
bulbazord added inline comments.Jun 26 2023, 11:23 AM
lldb/source/Host/common/FileSystem.cpp
229–230

nit: Unused Resolver.

JDevlieghere marked an inline comment as done.

Remove unused Resolver.

This revision is now accepted and ready to land.Jun 27 2023, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 2:19 PM