[Lldb-commits] [PATCH] D131531: [lldb] Allow DataFileCache to be constructed with a different policy

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 10 13:20:55 PDT 2022


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lldb/source/Core/DataFileCache.cpp:23-46
+llvm::CachePruningPolicy DataFileCache::GetLLDBIndexCachePolicy() {
+  static llvm::CachePruningPolicy policy;
+  static llvm::once_flag once_flag;
+
+  llvm::call_once(once_flag, []() {
+    // Prune the cache based off of the LLDB settings each time we create a
+    // cache object.
----------------
I was worried that by caching the policy here, changing the `lldb-index-cache-` settings after the first DataFileCache has been created won't have any effect. But it looks like the DataFileCache is already a static/global used by the Modules, so that's already the case in practice. Maybe a follow-up patch could make that explicit in the help `enable-lldb-index-cache` help description. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131531/new/

https://reviews.llvm.org/D131531



More information about the lldb-commits mailing list