Files
llvm-project/llvm/lib/Debuginfod/BuildIDFetcher.cpp
gulfemsavrun c7eea85b80 Revert "[llvm-cov] Fix error propagation in CoverageMapping::load() (… (#193266)
…#193197)"

This reverts commit b7cfcfe03d.

Revert "[llvm] Errorize DebuginfodFetcher for inspection at call-sites
(#191191)"

This reverts commit 337ad44a3e.

Reason for revert: Caused debuginfod tests failed in profile runtime:

https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8683917826498677969/overview
2026-04-21 17:34:43 +00:00

32 lines
1.0 KiB
C++

//===- llvm/DebugInfod/BuildIDFetcher.cpp - Build ID fetcher --------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file defines a DIFetcher implementation for obtaining debug info
/// from debuginfod.
///
//===----------------------------------------------------------------------===//
#include "llvm/Debuginfod/BuildIDFetcher.h"
#include "llvm/Debuginfod/Debuginfod.h"
using namespace llvm;
std::optional<std::string>
DebuginfodFetcher::fetch(ArrayRef<uint8_t> BuildID) const {
if (std::optional<std::string> Path = BuildIDFetcher::fetch(BuildID))
return std::move(*Path);
Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);
if (PathOrErr)
return *PathOrErr;
consumeError(PathOrErr.takeError());
return std::nullopt;
}