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

Juan Manuel Martinez CaamaƱo via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 17 02:17:58 PDT 2026


================
@@ -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();
----------------
jmmartinez wrote:

On one path the error doesn't lead to an abort; the expected is converted to an optional (so we will not be erroring. And that optional sometimes leads to an error, sometimes no, sometimes it's propagated upwards...

Lets turn this into a warning...

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


More information about the lldb-commits mailing list