LLVM 20.0.0git
BuildIDFetcher.cpp
Go to the documentation of this file.
1//===- llvm/DebugInfod/BuildIDFetcher.cpp - Build ID fetcher --------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines a DIFetcher implementation for obtaining debug info
11/// from debuginfod.
12///
13//===----------------------------------------------------------------------===//
14
16
18
19using namespace llvm;
20
21std::optional<std::string>
23 if (std::optional<std::string> Path = BuildIDFetcher::fetch(BuildID))
24 return std::move(*Path);
25
27 if (PathOrErr)
28 return *PathOrErr;
29 consumeError(PathOrErr.takeError());
30 return std::nullopt;
31}
This file declares a Build ID fetcher implementation for obtaining debug info from debuginfod.
This file contains several declarations for the debuginfod client and server.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
std::optional< std::string > fetch(object::BuildIDRef BuildID) const override
Fetches the given Build ID using debuginfod and returns a local path to the resulting file.
Tagged union holding either a T or a Error.
Definition: Error.h:481
Error takeError()
Take ownership of the stored error.
Definition: Error.h:608
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Expected< std::string > getCachedOrDownloadDebuginfo(object::BuildIDRef ID)
Fetches a debug binary by searching the default local cache directory and server URLs.
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1069