[Lldb-commits] [lld] [lldb] [llvm] [Support][Cache] Make `pruneCache` return an `Expected` (PR #191367)

Chinmay Deshpande via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 16 08:43:36 PDT 2026


Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/191367 at github.com>


================
@@ -274,7 +320,10 @@ Expected<std::string> getCachedOrDownloadArtifact(
         parseCachePruningPolicy(std::getenv("DEBUGINFOD_CACHE_POLICY"));
     if (!PruningPolicyOrErr)
       return PruningPolicyOrErr.takeError();
-    pruneCache(CacheDirectoryPath, *PruningPolicyOrErr);
+
+    auto ErrOrPruned = pruneCache(CacheDirectoryPath, *PruningPolicyOrErr);
+    if (!ErrOrPruned)
+      return ErrOrPruned.takeError();
----------------
chinmaydd wrote:

Okay, I think that makes sense. Though we should document that this is a new error that the callers of `getCachedOrDownloadArtifact` should be aware of (if there is some documentation of errors this can return).

I would appreciate if you could perform a cursory glance over the callers to see if we arent breaking any expectations.

https://github.com/llvm/llvm-project/pull/191367


More information about the lldb-commits mailing list