[llvm] [llvm] Errorize DebuginfodFetcher::fetch() for inspection at call-sites (NFC) (PR #191191)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 02:05:29 PDT 2026


================
@@ -1106,19 +1106,21 @@ Expected<std::unique_ptr<CoverageMapping>> CoverageMapping::load(
     }
 
     for (object::BuildIDRef BinaryID : BinaryIDsToFetch) {
-      std::optional<std::string> PathOpt = BIDFetcher->fetch(BinaryID);
-      if (PathOpt) {
-        std::string Path = std::move(*PathOpt);
+      Expected<std::string> Path = BIDFetcher->fetch(BinaryID);
+      if (Path) {
----------------
DavidSpickett wrote:

`if (Expected<...`, since `Path` does not escape the if/else.

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


More information about the llvm-commits mailing list